Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centos6.9 安装mysql5.7 #2

Open
w3eee opened this issue Apr 3, 2019 · 0 comments
Open

Centos6.9 安装mysql5.7 #2

w3eee opened this issue Apr 3, 2019 · 0 comments

Comments

@w3eee
Copy link
Owner

w3eee commented Apr 3, 2019

  • 删除系统自带mysql5.1 如果安装的话
    yum list installed | grep mysql
    yum -y remove mysql-libs.x86_64

  • 下载并安装源
    wget dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
    yum localinstall mysql-community-release-el6-5.noarch.rpm
    yum repolist all | grep mysql # 查看启用情况

  • 启用mysql57
    vim /etc/yum.repos.d/mysql-community.repo # 将57的enabled改成1, 56的改成0

  • 安装并启动服务
    yum install mysql-community-server
    service start mysqld

  • 配置
    grep 'temporary password' /var/log/mysqld.log # 查看临时密码
    mysql -uroot -p # 使用临时密码登录
    ALTER USER 'root'@'localhost' IDENTIFIED BY 'Mdfd@ddwPass2!'; # 修改密码

    配置文件位于 /etc/my.cnf

  • 添加用户
    create user test identified by 'test';
    grant all privileges on xxdb.* to test@'%' identified by 'test';
    flush privileges;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant