概述
#注意,本脚本在redhat5.0以后版本或者centos5.0以后版本,运行,需要先安装开发工具和开发库软件组。
#!/bin/bash
cd
useradd mysql
wget http://122.225.32.131/icons/mysql-5.0.22.tar.gz
tar -zxvf mysql-5.0.22.tar.gz
cd mysql-5.0.22
mkdir /usr/local/mysql
./configure
--prefix=/usr/local/mysql
--without-debug
--enable-thread-safe-client
--enable-assembler
--enable-profiling
--with-mysqld-ldflags=-all-static
--with-client-ldflags=-all-static
--with-charset=latin1
--with-extra-charsets=all
--with-big-tables
--enable-largefile
cd
useradd mysql
wget http://122.225.32.131/icons/mysql-5.0.22.tar.gz
tar -zxvf mysql-5.0.22.tar.gz
cd mysql-5.0.22
mkdir /usr/local/mysql
./configure
--prefix=/usr/local/mysql
--without-debug
--enable-thread-safe-client
--enable-assembler
--enable-profiling
--with-mysqld-ldflags=-all-static
--with-client-ldflags=-all-static
--with-charset=latin1
--with-extra-charsets=all
--with-big-tables
--enable-largefile
make && make install
cd /etc
rm -f my.cnf
wget http://122.225.32.131/icons/my.cnf
cd /usr/local/mysql/bin
./mysql_install_db --user=mysql
./mysqld_safe --user=mysql &
cp /root/mysql-5.0.22/support-files/mysql.server /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 345 mysqld on
sleep 3
mysql -uroot mysql -e "delete from user where user = '';"
cd /etc
rm -f my.cnf
wget http://122.225.32.131/icons/my.cnf
cd /usr/local/mysql/bin
./mysql_install_db --user=mysql
./mysqld_safe --user=mysql &
cp /root/mysql-5.0.22/support-files/mysql.server /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 345 mysqld on
sleep 3
mysql -uroot mysql -e "delete from user where user = '';"
转载于:https://blog.51cto.com/linuxguest/309088
最后
以上就是尊敬往事为你收集整理的脚本安装mysql的全部内容,希望文章能够帮你解决脚本安装mysql所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复