wget http://mirror.neu.edu.cn/mysql/Downloads/MySQL-5.6/mysql-5.6.16-linux-glibc2.5-x86_64.tar.gz tar zxvf mysql-5.6.16.tar.gz -C /usr/local/webserver mv mysql-5.6.16 mysql
shell> groupadd mysql shell> useradd -r -g mysql mysql shell> cd /usr/local/webserver/mysql shell> chown -R mysql . shell> chgrp -R mysql . shell> scripts/mysql_install_db --user=mysql shell> chown -R root . shell> chown -R mysql data # Next command is optional shell> cp support-files/my-default.cnf /etc/my.cnf shell> bin/mysqld_safe --user=mysql &
将 basedir= datadir= 改为 basedir=/usr/local/webserver/mysql datadir=/usr/local/webserver/mysql/data
cd /usr/local/webserver/mysql cp support-files/mysql.server /etc/init.d/mysql
service mysql start service mysql stop service mysql restart
我们需要先设置PATH,要不不能直接调用mysql修改/etc/profile文件,在文件末尾添加
export PATH="/usr/local/webserver/mysql/bin:$PATH"关闭文件,运行下面的命令,让配置立即生效
source /etc/profile