MySQL error message from Server:error 1062 (23000):

Source: Internet
Author: User

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):

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.