: java.sql.SQLException: null, message from server: "Host 'skylong' is not

Recommended for you: Get network issues from WhatsUp Gold. Not end users.
1. Alter table method.

May be your account is not allowed from the remote login, only in localhost. This time, as long as the computer localhost, log mysql, change the "MySQL" database "user" and "host", "localhost" was renamed from"%"

mysql -u root -p123456>use mysql;

mysql>update user set host = '%' where user = 'root';

mysql>select host, user from user;

The 2 Authorization Act.

For example, you want to use root 123456 to connect to the MySQL server from any computer.

GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;

FLUSH   PRIVILEGES;

If you want to allow the user to muser from the IP to the MySQL server for the 192.168.1.116 connection, and the use of 123456 as a password

GRANT ALL PRIVILEGES ON *.* TO 'muser'@'192.168.1.116' IDENTIFIED BY '123456' WITH GRANT OPTION;

FLUSH   PRIVILEGES;

If you want to allow the user to muser from IP to MySQL server test database for the 192.168.1.116 connection, and the use of 123456 as a password

GRANT ALL PRIVILEGES ON dk.* TO 'muser'@'192.168.1.116' IDENTIFIED BY '123456' WITH GRANT OPTION;

FLUSH   PRIVILEGES;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Maximilian at December 18, 2013 - 10:26 PM