zoukankan      html  css  js  c++  java
  • ubuntu下mysql远程连接

    第一步:

    vim /etc/mysql/my.cnf找到bind-address = 127.0.0.1

    注释掉这行,如:#bind-address = 127.0.0.1                   //只允许本地访问

    或者改为: bind-address = 0.0.0.0                          //允许任意ip访问

    或者自己指定一个IP地址。

    重启 MySQL:sudo /etc/init.d/mysql restart

    第二步:

    授权用户能进行远程连接

       grant all privileges on *.* to root@"%" identified by "password" with grant option;  //*.*:第一个*代表数据库名;第二个*代表表名。root:授予root账号。“%”:表示授权的用户IP可以指定,这里代表

                                                                                                                                  任意的IP地址都能访问MySQL数据库。“password”:分配账号对应的密码,这里密码自己替换成你的mysql root帐号密码。

       flush privileges;                      //刷新权限信息,也即是让我们所作的设置马上生效。

    [1] https://www.cnblogs.com/gdsblog/p/7349551.html

  • 相关阅读:
    innodb buffer pool小解
    information_schema系列十一
    Shader编程教程
    第四章 继承
    第三章 对象和类型
    第二章:核心C#
    前言和第一章.NET的体系结构
    单例模式
    代理模式
    第 1 章 策略模式【Strategy Pattern】
  • 原文地址:https://www.cnblogs.com/wubdut/p/4660938.html
Copyright © 2011-2022 走看看