Linux CentOS 6 版本下安装 MySQL5.6:
cd /usr/local/src/ yum install -y wget perl-Module-Install.noarch wget --no-check-certificate https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz tar xf mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz mv mysql-5.6.35-linux-glibc2.5-x86_64 /usr/local/mysql cd /usr/local/mysql/ useradd mysql mkdir /data ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql cp support-files/my-default.cnf /etc/my.cnf cp support-files/mysql.server /etc/init.d/mysqld echo "basedir = /usr/local/mysql" >> /etc/my.cnf echo "datadir = /data/mysql" >> /etc/my.cnf echo "socket = /tmp/mysql.sock" >> /etc/my.cnf sed -i '46s#basedir=#basedir=/usr/local/mysql#g' /etc/init.d/mysqld sed -i '47s#datadir=#datadir=/data/mysql#g' /etc/init.d/mysqld /etc/init.d/mysqld start chkconfig --add mysqld chkconfig mysqld on