centos6.8下安装mysql(yum方式)

0. 检测是否有安装mysql,如有则需卸载

(# yum list installed | grep mysql)

(# yum -y remove mysql*)

1. 查看yum中的mysql版本

(# yum remove mysql*)

2. 按需要选择其中一个安装

(# yum install mysql-server vim -y)

3.修改权限

()

4.添加开机启动

(# cp support-files/mysql.server /etc/init.d/mysql)

5.启动mysql

  (# service mysql start)

    检查mysql的启动状态

  (# systemctl status mysqld)

6.修改配置文件

(# vim  /etc/my.cnf)

7.登录mysql

(# mysql -u root -p)

8.设置登录密码

(# ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password'; )


9.添加远程访问权限

(# grant all privileges on gx.* to 'test'@'%' identified by 'password';)

你可能感兴趣的:(centos6.8下安装mysql(yum方式))