文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

Navicat-MySQL报错1449 - The user specified as a definer (‘mysqlinfoschema‘@‘localhost‘) does not exist

2023-09-07 13:03

关注

问题:Ubuntu20.04虚拟机部署了MySQL8.0.32,本机Navicat连接MySQL,测试连接成功,但是确定后连接报错:1449 - The user specified as a definer ('mysqlinfoschema'@'localhost') does not exist。

解决方案:‘mysql.infoschema’@‘localhost’ 是一个用户,检查时该用户可以查询到已经存在,但是show tables报错,并不存在,不能创建此用户,需要先删除再次创建,并且赋予权限给这个用户后,Navicat尝试连接,连接成功,完美。

执行过程如下:

root@ubuntu:~$ sudo mysql -u root -pEnter password: Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 542Server version: 8.0.32-0ubuntu0.20.04.2 (Ubuntu)Copyright (c) 2000, 2023, Oracle and/or its affiliates.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> use mysql;Database changedmysql> show tables;ERROR 1449 (HY000): The user specified as a definer ('mysql.infoschema'@'localhost') does not existmysql> drop user 'mysql.infoschema'@'localhost';Query OK, 0 rows affected (0.01 sec)mysql> show tables;ERROR 1449 (HY000): The user specified as a definer ('mysql.infoschema'@'localhost') does not existmysql> select user,host from user;+------------------+-----------+| user             | host      |+------------------+-----------+| root             | %         || debian-sys-maint | localhost || mysql.session    | localhost || mysql.sys        | localhost |+------------------+-----------+5 rows in set (0.00 sec)mysql> flush prvileges;ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'prvileges' at line 1mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)mysql> create user 'mysql.infoschema'@'localhost' identified by '123456'; Query OK, 0 rows affected (0.00 sec)mysql> select user,host from user;+------------------+-----------+| user             | host      |+------------------+-----------+| root             | %         || debian-sys-maint | localhost || mysql.infoschema | localhost || mysql.session    | localhost || mysql.sys        | localhost |+------------------+-----------+6 rows in set (0.01 sec)mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)mysql> grant all privileges on *.* to 'mysql.infoschema'@'localhost' with grant option;Query OK, 0 rows affected (0.00 sec)mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)mysql> show tables;+------------------------------------------------------+| Tables_in_mysql          |+------------------------------------------------------+| columns_priv             || component                || db                       || default_roles            || engine_cost              || func                     || general_log              || global_grants            || gtid_executed            || help_category            || help_keyword             || help_relation            || help_topic               || innodb_index_stats       || innodb_table_stats       || password_history         || plugin                   || procs_priv               || proxies_priv             || replication_asynchronous_connection_failover         || replication_asynchronous_connection_failover_managed || replication_group_configuration_version              || replication_group_member_actions                     || role_edges               || server_cost              || servers                  || slave_master_info        || slave_relay_log_info     || slave_worker_info        || slow_log                 || tables_priv              || time_zone                || time_zone_leap_second    || time_zone_name           || time_zone_transition     || time_zone_transition_type|| user                     |+------------------------------------------------------+37 rows in set (0.00 sec)mysql> 

 总结:删除该提示用户,再次创建该用户,赋予权限,Navicat连接成功。

 

 

 

来源地址:https://blog.csdn.net/weixin_59518897/article/details/130341917

阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-数据库
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯