CentOS7.2安装MySQL

快速下载安装MysqL

# wget http://dev.MysqL.com/get/MysqL-community-release-el7-5.noarch.rpm
# rpm -ivh MysqL-community-release-el7-5.noarch.rpm
# yum install MysqL-community-server

成功安装之后重启MysqL服务

# service MysqLd restart

设置密码

# MysqL -u root MysqL
MysqL> UPDATE user SET Password=PASSWORD('123456') where USER='root' and host='root' or host='localhost';

MysqL> FLUSH PRIVILEGES;
# quit

启动MysqL

# service MysqL start
# MysqL -uroot -p123456

MysqL5.6操作时报错:You must SET PASSWORD before executing this statement解决

MysqL> SET PASSWORD = PASSWORD('123456');

设置远程连接

MysqL> grant all on *.* to root@'%' identified by '123456';

开启端口
首先在阿里云安全组添加 3306端口
在开启防火墙端口

# firewall-cmd --permanent --zone=public --add-port=3306/tcp
# firewall-cmd --reload

相关文章

Centos下搭建性能监控Spotlight
CentOS 6.3下Strongswan搭建IPSec VPN
在CentOS6.5上安装Skype与QQ
阿里云基于centos6.5主机VPN配置
CentOS 6.3下配置multipah
CentOS安装、配置APR和tomcat-native