MYSQL 远程连接问题

来源:互联网 发布:青少年编程培训加盟 编辑:程序博客网 时间:2024/06/11 05:25

我用localhos能连上自己的数据库,但是用本机的ip地址就连不上,在网上找了一下,原来是要进行下面的设置才可以。

 

 

远程连接问题,大家可以参考:
1、MYSQL服务器上:
比如:
C:/
>mysql -uroot -p
Enter password:
******
Welcome
to the MySQL monitor.  Commands end with ; or /g.
Your MySQL connection id
is 2
Server version:
5.1.22-rc-community-log MySQL Community Server (GPL)

Type
'help;' or '/h' for help. Type '/c' to clear the buffer.

mysql
> grant all privileges on *.* to 'yourname'@'%' identified by 'youpasswd';
Query OK,
0 rows affected (0.05 sec)

mysql
> flush privileges;
Query OK,
0 rows affected (0.06 sec)

mysql
> exit
Bye
开启3306的方法:
http:
//www.google.cn/search?hl=zh-CN&q=%E5%BC%80%E5%90%AF3306&meta=
2、这里假设用SQLYog连接MYSQL服务器。
客户端机器上:
HOST ADDRESS:服务端IP地址
USER NAME:yourname
PASSWORD:yourpasswd
PORTS:
3306
DATABASES:可以留空。

原创粉丝点击