1.列出mysql列表
yum list mysql-server
2.进行在线安装
yum install mysql-server
3.启动mysql服务
service mysqld start
4.测试连接
mysql
然后
\q
关闭连接
5.设置Mysql开机启动
chkconfig mysqld on
6.
开启3306端口并保存
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
/etc/rc.d/init.d/iptables save
7.修改密码:
连接mysql数据库
设置密码
use mysql;
update user set password=password('密码') where user='root';
flush privileges;
8.设置Mysql远程访问
grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
连接mysql
mysql -uroot -p,回车后提示你输密码
远程连接mysql
mysql -h110.110.110.110 -uroot -pabcd123