centos6.8 安装 mysql5.6

安装过程

  • 检查系统是否存在其他版本的mysql
 rpm -qa | grep -i mysql

如果有其他版本,可将版本移除

rpm -e --nodeps 版本号(mysql-libs-5.1.73-8.el6_8.x86_64)

-给centos添加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

-安装mysql

yum install mysql-community-server -y

-启动mysql

service mysqld start

-查看mysql是否自启动,并且设置开启自启动

chkconfig --list | grep mysqld
chkconfig mysqld on

-设置密码

/usr/bin/mysqladmin -u root password 'secret'
  • 修改root密码
mysql -uroot -p123456
mysql> use mysql;
mysql> select Host,User,Password from user where User='root';
mysql> update user set Password = password('123456') where User='root';
mysql> flush privileges;
  • 完成✌️

你可能感兴趣的:(centos6.8 安装 mysql5.6)