linux 服务器安装mysql5.6

 

1.移除CentOS默认的mysql-libs: whereis mysql

2.为了避免冲突,先移除CenttOS上默认的mysql-libs: yum remove mysql-libs

linux 服务器安装mysql5.6_第1张图片

3.然后,使用yum clean dbcache清空db缓存:

 

4.下载MySQL rpm安装包:


wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm

 


rpm -ivh mysql-community-release-el6-5.noarch.rpm

 


yum repolist all | grep mysql

linux 服务器安装mysql5.6_第2张图片

 

  5.yum install mysql-community-server -y

linux 服务器安装mysql5.6_第3张图片

 

6.设置为开机自启动

chkconfig --list | grep mysqld

chkconfig mysqld on

 

7.启动

linux 服务器安装mysql5.6_第4张图片

 

8.设置密码:
/usr/bin/mysqladmin -u root password '123456

 

9.修改密码:

mysql -uroot -p密码

update user set password = PASSWORD("xxxxxxxx") where user = "root"

10.退出数据库,exit;

11.重启数据库服务,service mysqld restart

over.

 

你可能感兴趣的:(linux 服务器安装mysql5.6)