centos6.5安装mysql5.6

What

mysql是 传统关系型数据库

Why

centos 一般自带的都是比较老的版本 ,需要新版版

How

  1. 查看并删除老版本 yum list installed | grep mysql yum -y remove mysql-libs.x86_64
  2. 下载yum源文件并安装 https://dev.mysql.com/downloads/repo/yum/
  • wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
  • rpm -ivh mysql-community-release-el6-5.noarch.rpm
  1. 查看一下是否已经有mysql可安装文件 yum repolist all | grep mysql sudo yum-config-manager --disable mysql80-community sudo yum-config-manager --enable mysql57-community

  2. 安装mysql 服务器命令 yum install mysql-community-server

  3. 启动服务 service mysqld start

  4. 进入mysql mysql -u root

    1
    2
    3
    4
    use mysql;
    update user set password=123456 where User='root';
    GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
    flush privileges;

注意点

跳过权限

  • mysqld_safe --skip-grant-tables
  • use mysql;
  • UPDATE user SET Password=PASSWORD('123456') where USER='root'; FLUSH PRIVILEGES;

参考

Juforg wechat
欢迎您扫一扫上面的微信公众号,订阅我的博客!