When you get an error message like this:
javax.security.sasl.AuthenticationException: Database Error: java.sql.SQLException: null, message from server: "Host 'xx.xx.xx.xx' is not allowed to connect to this MySQL server"
It show that you are not configured the MySql Server correctly. To configure a MySql Server for accessing remotely you need to grant permission for the client in the Server. Here is the Linux command line codes:
root@server:~# mysql -u<username> -p<password> - log in to MySql
> grant all on cheque_alert.* to '<user>'@'<IP address of remote system>';
This will grant all permission to the client machine from the IP:xxx.xxx.xx.xxx
To view the permission for any client:
> SHOW GRANTS FOR '<user>'@'xxx.xxx.xx.xxx';
eg.: SHOW GRANTS FOR 'root'@'11.111.105.111';
To remove the Grant/permission :
> DROP USER '<user>'@'xxx.xxx.xx.xxx';
eg.: DROP USER 'root'@'11.111.105.111';
The SQL commands can also be used in Windows System.
Comments