使root用户可以通过ip来访问mysql

mysql> grant all privileges on *.* to 'root'@'192.168.61.113'
    -> identified by 'root' with grant option;
Query OK, 0 rows affected (0.05 sec)

mysql> select host,user from mysql.user;
+----------------+--------+
| host           | user   |
+----------------+--------+
| 192.168.61.113 | root   |
| localhost      | jason  |
| localhost      | prod   |
| localhost      | qsrock |
| localhost      | radius |
| localhost      | root   |
+----------------+--------+



Class.forName("com.mysql.jdbc.Driver");
			Connection conn = DriverManager.getConnection("jdbc:mysql://192.168.61.113:3306/xx", "root", "root");

关于帐户权限可以参考:http://blog.chinaunix.net/u2/79621/showart_1210771.html

你可能感兴趣的:(html,.net,mysql,jdbc,Blog)