Download MySQL 5.6.15 from http://dev.mysql.com/downloads/ shell> groupadd mysql // shell> useradd -r -g mysql mysql // shell> cd /usr/local // shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz // shell> ln -s full-path-to-mysql-VERSION-OS mysql // shell> cd 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 // shell> bin/mysqld_safe --user=mysql & // # Next command is optional shell> cp support-files/mysql.server /etc/init.d/mysql.server start Mysql #/etc/init.d/mysql start 设置mysql的root 密码;注意设置密码的时候一定用password 函数。 # /etc/init.d/mysql stop # mysqld_safe --user=mysql --skip-grant-tables --skip-networking & # mysql -u root mysql mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root'; mysql> FLUSH PRIVILEGES; mysql> quit# /etc/init.d/mysql restart # mysql -uroot -p Enter password: <输入新设的密码newpassword>