mysql5问题
msyql5默认的root用户没有%默认对所有主机有访问权限了。所以
url="jdbc:mysql://127.0.0.1/mydatabase",可以正常了连接;
但url="jdbc:mysql://192.168.3.233/mydatabase"就连接不上了,提示"Host is not allowed to connect to this MySQL server"
只要给host为'192.168.3.233'的用户授予访问权限,在mysql中执行就可以:
GRANT ALL PRIVILEGES ON mydatabase.* TO 'username'@'192.168.3.233' IDENTIFIED BY 'password';
url="jdbc:mysql://127.0.0.1/mydatabase",可以正常了连接;
但url="jdbc:mysql://192.168.3.233/mydatabase"就连接不上了,提示"Host is not allowed to connect to this MySQL server"
只要给host为'192.168.3.233'的用户授予访问权限,在mysql中执行就可以:
GRANT ALL PRIVILEGES ON mydatabase.* TO 'username'@'192.168.3.233' IDENTIFIED BY 'password';