美文网首页
centOs7安装mysql5.7

centOs7安装mysql5.7

作者: JackeeM | 来源:发表于2019-06-29 10:00 被阅读0次

系统 --- centOs7

安装mysql5.7

  • 添加mysql到YUM源

    sudo rpm -ivh https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

  • 安装mysql

    sudo yum -y install mysql-community-server

  • 启动mysql

    systemctl start mysqld
    systemctl stop mysqld
    systemctl status mysqld
    systemctl restart mysqld
    
  • 查看密码

    cat /var/log/mysqld.log | grep -i 'temporary password'

  • 修改密码

    https://github.com/jaywcjlove/mysql-tutorial/blob/master/chapter17/17.3.md

    问题 You must reset your password using ALTER USER statement before executing this statement.

    mysql> set password=password("youpassword");

  • 允许远程连接

    1.允许root用户在任何地方进行远程登录,并具有所有库任何操作权限:

    mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY "设置密码" WITH GRANT OPTION;
    
    mysql> FLUSH PRIVILEGES;mysql>exit;
    

参考

https://juejin.im/post/5c088b066fb9a049d4419985

https://github.com/jaywcjlove/mysql-tutorial/blob/master/chapter17/17.3.md

相关文章

网友评论

      本文标题:centOs7安装mysql5.7

      本文链接:https://www.haomeiwen.com/subject/qdvucctx.html