首页 > 数据库 >配置SQLDeveloper连接mysql时报错Message from server:”host ‘****’ is not allowed to connect to this mysql ser

配置SQLDeveloper连接mysql时报错Message from server:”host ‘****’ is not allowed to connect to this mysql ser

时间:2023-06-09 18:01:56浏览次数:47  
标签:+-----------+------------------+ mysql server host user allowed root localhost

问题描述:配置SQLDeveloper连接mysql时报错Message from server:”host ‘****’ is not allowed to connect to this mysql server”,如下所示:
数据库:mysql 8.0.27
SQL Developer版本:23.1.0.097
连接mysql使用的驱动文件:mysql-connector-j-8.0.33.jar
1、异常重现

配置SQLDeveloper连接mysql时报错Message from server:”host ‘****’ is not allowed to connect to this mysql ser_SQL Developer

2、解决过程
[root@leo-mysql ~]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.11 MySQL Community Server - GPL

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select host,user from user;
+-----------+------------------+
| host      | user             |
+-----------+------------------+
| leo-mysql | alina            |
| localhost | mysql.infoschema |
| localhost | mysql.session    |
| localhost | mysql.sys        |
| localhost | root             |
| localhost | testuser         |
+-----------+------------------+
6 rows in set (0.00 sec)

mysql> update user set host='%' where user='root';
Query OK, 1 row affected (0.03 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> select host,user from user;
+-----------+------------------+
| host      | user             |
+-----------+------------------+
| %         | root             |
| leo-mysql | alina            |
| localhost | mysql.infoschema |
| localhost | mysql.session    |
| localhost | mysql.sys        |
| localhost | testuser         |
+-----------+------------------+
6 rows in set (0.00 sec)

mysql> grant all on *.* to 'root'@'%';
Query OK, 0 rows affected (0.07 sec)
3、连接验证

配置SQLDeveloper连接mysql时报错Message from server:”host ‘****’ is not allowed to connect to this mysql ser_SQL Developer_02

配置SQLDeveloper连接mysql时报错Message from server:”host ‘****’ is not allowed to connect to this mysql ser_SQL Developer_03

说明:如上所示,sql developer成功连接mysql数据库.

标签:+-----------+------------------+,mysql,server,host,user,allowed,root,localhost
From: https://blog.51cto.com/u_12991611/6449721

相关文章

  • mysql 8.0.26 my.cnf 配置文件模板
    ##############[mysqld]basedir=/home/work/mysql_3306datadir=/home/work/mysql_3306/datatmpdir=/home/work/mysql_3306/tmppid_file=/home/work/mysql_3306/tmp/mysqld.pidsocket=/home/work/mysql_3306/tmp/mysql.sockmysqlx_socket=/home/work/mysql......
  • 简单网络编程--TCP SERVER 端
     一个服务器,接受客户连接,返回客户IP地址,并关闭连接。一个服务器程序的基本步骤:1.winsocklibrary的初始化2.创建socket3.服务器地址4.bind->listen5.等待客户连接accept6.处理客户接入7.关闭socket8.释放资源:winsocklibrary//SimpleTcpServe......
  • Mysql必知必会教程--数据过滤
    关键字:where这里只说明不匹配的用法,其他的较为简单,不予叙述。selectvend_id,prod_namefromproductswherevend_id<>1003;输出结果:+---------+--------------+|vend_id|prod_name|+---------+--------------+|1001|.5tonanvil||1001|1tonan......
  • mysql管理多服务器ftp虚拟用户
    前言1.FTP虚拟用户:FTP虚拟用户由ftp服务器提供,依赖于一个服务器本地账号,可以同时设置多个虚拟账号。vsftpd分辨虚拟用户,由可插入认证模块(PAM)认证,该模块的账号信息可用文件或者数据库存储。FTP虚拟用户是FTP服务器的专有用户,使用虚拟用户账号可以提供集中管理的FTP根目录,方便......
  • sql server 取当天所在第几周
    DECLARE@dateDATETIMESET@date='2023-06-01'--一周的第一天SELECTDATEADD(DAY,2-DATEPART(weekday,@date),@date)--一周的最后一天SELECTDATEADD(DAY,8-DATEPART(WeekDay,@date),@date)declare@datetimedatetime;;set@datetime=getdate();selectdateadd(day,1-(date......
  • MySql必知必会教程--排序检索数据
    重点关键字:orderby排序单列数据:selectprod_namefromproductsorderbyprod_name;输出结果:+----------------+|prod_name|+----------------+|.5tonanvil||1tonanvil||2tonanvil||Birdseed||Carrots||Detonator......
  • MySQL事务日志
    事务的四种特性:原子性、一致性、隔离性和持久性。事务的隔离性由锁机制实现。事务的原子性、一致性和持久性由事务的redo日志和undo日志来保证。redolog:重做日志,提供再写入操作,恢复提交事务修改过的页操作,用来保证事务的持久性undolog:回滚日志,回滚行记录到某个特定版本,用来......
  • binlog_parse_clickhouse.py(ETL抽数据工具)将MySQL8.0迁移至ClickHouse
    binlog_parse_clickhouse.py(ETL抽数据工具)将MySQL8.0迁移至ClickHouse原理:将解析binlog和执行SQL语句两个过程由两个线程来执行。其中,解析binlog的线程每次解析完一个事件后通过队列将SQL语句传给SQL执行线程,SQL执行线程从队列中取出SQL语句并按顺序依次执行,这样就保......
  • sql server 行列转换
    sqlserver行列转换 目录【1】创建测试数据【2】行转列方法1:casewhen方法2:pivot【3】列转行:(或可以用unionall做列传行)【4】行列转换实践(1)常规列转行(2)实用列传行【5】分隔符行列转换1、行转列,以','号为分隔符2.列转行 回到顶部【1】创建测试......
  • MySQL中查询第2-5条记录的语句为
    查询第m行到第n行记录,注意表中的记录下标是从0开始的,就像数组一样select*fromstudentlimitm,n;返回m+1到m+n行记录,m代表开始的下标,n代表查找的结果数,将返回n行结果select*fromstudentlimit2,8;返回3到10行记录 ......