您的位置:首页 > 运维架构 > Linux

CentOS在线安装MySQL5.6

2016-03-08 23:25 555 查看
1、安装rpm包
rpm -Uvhhttp://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

2、查看mysql可用的源

yum repolistenabled | grep "mysql.*-community.*"



3、yum安装mysql5.6

yum -y installmysql-community-server

4、开机启动

systemctl enablemysqld

5、启动mysqld服务

systemctl startmysqld

6、修改MySQL的root用户的密码:
 
# mysql -u root mysql

mysql>use mysql;
mysql>desc user;
mysql> GRANT ALL PRIVILEGES ON *.* TOroot@"%" IDENTIFIED BY "root";  //为root添加远程连接的能力。
mysql>update user set Password = password('xxxxxx')where User='root';
mysql>select Host,User,Password  from user where User='root';
mysql>flush privileges;
mysql>exit
 
重新登录:mysql -u root -p
7、添加软链接
# ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql
# ln -s /usr/local/mysql/include/mysql/usr/include/mysql
8、同时注意防火墙是否已关闭或者添加例外
CentOS防火墙
 关闭firewall:
systemctl
stop firewalld.service #停止firewall
systemctl
disable firewalld.service #禁止firewall开机启动
systemctl
enable iptables.service #设置开机启动


firewall-cmd
--state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: