CentOS6.9安装MySQL5.6
1.检查系统自带mysql
yum list installed | grep mysql
2.卸载
yum -y remove mysql-libs.x86_64
3.安装mysql5.6
wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
当前目录下会下载一个mysql-community-release-el6-5.noarch.rpm的包
安装
rpm -ivh mysql-community-release-el6-5.noarch.rpm
查看是否存在可安装的软件
yum repolist all | grep mysql
进行安装
yum install mysql-community-server
4.启动
service mysqld start
5.修改密码
mysql -u root
use mysql;
update user set password=PASSWORD("root") where User='root';
flush privileges;
6.设置远程权限(登录mysql情况下设置)
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
FLUSH PRIVILEGES;
其中*.*代表所有资源所有权限,‘root’@’%'中root代表账户名,%代表所有的访问地址,IDENTIFIED BY ‘root’,这个root是指访问密码,WITH GRANT OPTION允许级联授权。
7.设置MySQL开机启动
查看MySQL开机自启动
chkconfig --list | grep mysqld
设置自启动
chkconfig mysqld on