yum 安装mysql5.6.x

一、yum 安装mysql5.6.x

系统环境:centos6.8

#系统自带5.1.7数据库
[root@nulige ~]# yum list installed | grep mysql
mysql-libs.x86_64 5.1.73-7.el6 @anaconda-CentOS-201605220104.x86_64/6.8

#卸载自带mysql
[root@nulige ~]# yum -y remove mysql-libs.x86_64

#下载源
wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm

#安装yum源

yum install mysql-community-server -y

#查看源中mysql包
[root@nulige ~]# yum repolist all | grep mysql
mysql-connectors-community MySQL Connectors Community enabled: 66
mysql-connectors-community-source MySQL Connectors Community - S disabled
mysql-tools-community MySQL Tools Community enabled: 68
mysql-tools-community-source MySQL Tools Community - Source disabled
mysql55-community MySQL 5.5 Community Server disabled
mysql55-community-source MySQL 5.5 Community Server - S disabled
mysql56-community MySQL 5.6 Community Server enabled: 474
mysql56-community-source MySQL 5.6 Community Server - S disabled
mysql57-community-dmr MySQL 5.7 Community Server Dev disabled
mysql57-community-dmr-source MySQL 5.7 Community Server Dev disabled

#安装mysql
yum install mysql-community-server -y

#启动mysql
/etc/init.d/mysqld start


#登录mysql,修改密码
mysql -u root
use mysql;
update user set password=PASSWORD("这里输入root用户密码") where User='root';
flush privileges;


9.查看并设置开机自启动服务
chkconfig --list | grep mysqld
chkconfig mysqld on


10.mysql安全设置
mysql_secure_installation

 

posted @ 2018-11-20 16:40  努力哥  阅读(663)  评论(0编辑  收藏  举报