0、以root权限进入,su root
1、yum 安装mysql
1.1、yum -y install mysql-server
1.2、安装结果:
Installed:
mysql-server.x86_64 0:5.1.73-7.el6
Dependency Installed:
mysql.x86_64 0:5.1.73-7.el6 perl-DBD-MySQL.x86_64 0:4.013-3.el6
perl-DBI.x86_64 0:1.609-4.el6
Dependency Updated:
mysql-libs.x86_64 0:5.1.73-7.el6
Complete!
2、设置开机启动
2.1、chkconfig mysqld on
3、启动mysql服务
3.1、service mysqld start
4、设置MySQL的root用户设置密码
4.1、mysql -uroot
4.2、set password for root@localhost=password('root');
4.3、exit
5、开放远程登录权限
5.1、mysql -uroot -p
5.2、 grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
5.3、flush privileges;