MySQL connection error: Java.sql.sqlexception:null,message from server: "Host ' 27,45,38,132 ' isn't allowed to connect.
The reason: The remote server does not allow your Java program to access its database. So, let's set up the remote server so that it allows you to connect.
Tool Sqldeveloper when connecting to a remote MySQL database, configure connection information, connection error, prompt: Message from server: "Host ' 192.168.1.8 ' isn't allowed to connect to this MySQL Server
But change the IP address to localhost and connect to the MySQL database normally.
Temporary processing scenarios:
1, first connect to the MySQL database with localhost, and then use MySQL's own database MySQL;
# mysql -u root -penter password: Welcome to the MySQL monitor. Commands end with ; or \g.your mysql connection id is 971server version: 5.5.56-log Source distributionCopyright (c) 2000, 2017, Oracle and/or its Affiliates. all rights reserved. oracle is a registered trademark of oracle corporation and/or Itsaffiliates. other names may be trademarks of their respectiveowners . type ' help; ' or ' \h ' for help. Type ' \c ' to clear the current input statement.mysql>mysql> use mysql;database changedmysql> show tables;+- --------------------------+| tables_in_mysql |+---------------------------+| columns_priv | | db | | event | | func | | general_log | | help_category | | help_keyword | | help_relation | | help_topic | | host | | ndb_binlog_index | | plugin | | proc | | procs_priv | | proxies_priv | | servers | | slow_log | | tables_priv | | time_zone | | time_zone_leap_second | | time_zone_name | | time_zone_transition | | time_zone_transition_type | | user |+---------------------------+24 rows in set (0.00  SEC)
2. Execution:Select host from user where user = ' root '; found that the value of host is localhost.
So get rid of its value:update user set host= '% ' where user = ' root ';
ERROR 1062 (23000): Duplicate entry '%-root ' for key ' PRIMARY ' ignored
3, after the completion of the modification, implementation:flush privileges;
When the modifications are in effect, they can be connected to the MySQL database properly with the IP address or localhost when they are configured again.
MySQL error message from Server:error 1062 (23000):