zoukankan      html  css  js  c++  java
  • 如何设置mysql远程访问

    1.查看远程主机mysql服务状态

    1 [root@localhost ~]# service mysqld status
    2 mysqld is stopped

    2.启动远程机mysql服务

    如mysql服务未启动, 则先启动mysql服务

    [root@localhost ~]# /etc/init.d/mysqld start
    Starting MySQL:                                            [  OK  ]

    3.进入mysql

    [root@localhost ~]# mysql -u root -p
    Enter password: 
    Welcome to the MySQL monitor.  Commands end with ; or g.
    Your MySQL connection id is 2
    Server version: 5.0.45 Source distribution
    
    Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
    
    mysql>

    4.选择mysql库名

    1 mysql> use mysql;
    2 Reading table information for completion of table and column names
    3 You can turn off this feature to get a quicker startup with -A
    4 
    5 Database changed
    6 mysql> 

    5.将mysql库中, root用户的host由localhost改为%

    mysql> UPDATE user SET Host='%' WHERE User='root';

    6.打开防火墙的3306mysql默认端口, 可参照http://www.cnblogs.com/leaf1117/p/3461952.html              

             
    7.重启服务

  • 相关阅读:
    百度之星初赛 A
    百度之星 初赛 BC
    2016 百度之星资格赛
    codeforces 749
    codeforces 785
    HDU 4617
    网络流 poj 2195
    网络流 poj 3436 poj 3281
    codeforces 780 C
    idea激活
  • 原文地址:https://www.cnblogs.com/leaf1117/p/3461958.html
Copyright © 2011-2022 走看看