2018-08-21

作者: 尘世中一只迷途的羔羊 | 来源:发表于2018-08-21 23:49 被阅读0次

    阿里云中docker安装mysql配置Nacvicat连接

     docker pull mysql:5.7
     docker run --name mysql  -p 3306:3306  -e MYSQL_ROOT_PASSWORD=yourPassword mysql:5.7
    //本地测试连接mysql
     docker images #获取mysql的id
     docker exec -it f921ee773684 /bin/bash #进入到容器
    
    
    
    t.jpg
    #设置其它用户可连接
    mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
    Query OK, 0 rows affected (0.00 sec)
     
    mysql>FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.00 sec)
    mysql> select host,user from user;
    +-------------------------+------+
    | host                    | user |
    +-------------------------+------+
    | %                       | root |
    | 127.0.0.1               | root |
    | iz2ze3hkpeilimy9kn68tvz |      |
    | iz2ze3hkpeilimy9kn68tvz | root |
    | localhost               |      |
    | localhost               | root |
    +-------------------------+------+
    6 rows in set (0.00 sec)
    
    F.jpg

    相关文章

      网友评论

        本文标题:2018-08-21

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