1.卸载linux自带的mysql
1.1.查看
rpm -qa | grep mysql
1.2.卸载
rpm -e --nodeps 查看到的选项
2.安装mysql
2.1.yum安装
yum install -y mysql-server mysql mysql-deve
2.2.启动mysql
service mysqld start
2.3.查看mysql服务
ps –ef | grep mysql
2.4.登陆
mysql –u root –p
无密码
2.5.修改root密码
mysqladmin -u root password ‘root’
3.开启远程连接
3.1.开启端口
vi /etc/sysconfig/iptables
添加防火墙信息
重启防火墙:
service iptables restart
3.2.关闭selinux
关闭:setenforce 0
查看:getenforce
3.3.授权远程连接
GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘root’ WITH GRANT OPTION;
flush privileges;
4.用sqlyong链接mysql服务器
链接
5.开机启动
5.1.查看mysql是否开机启动
chkconfig --list | grep mysqld
5.2.开启mysql开机启动
chkconfig mysqld on