安装时请使用root用户。安装前准备两个rpm包:
MySQL-server-5.6.12-1.el6.x86_64.rpm
MySQL-client-5.6.12-1.el6.x86_64.rpm
1、安装服务端:
命令:rpm -ivh MySQL-server-5.6.12-1.el6.x86_64.rpm
2、安装客户端
命令:rpm -ivh MySQL-client-5.6.12-1.el6.x86_64.rpm
3、在Redhat中是不能使用空密码登录mysql的,请依次执行以下命令:
su root
?????? service mysql stop
?????? mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
?????? mysql -u root mysql
?????? UPDATE user SET Password=PASSWORD('123456') where USER='root';
?????? FLUSH PRIVILEGES;
?????? quit
?????? exit
?????? ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
?????? service mysql start
??? 执行完毕后,再次登录
mysql -uroot -p123456
4、登录后执行mysql命令时,还会提示设置密码,再次运行以下命令:
SET Password=PASSWORD('123456')
?
?