Error 1449 (HY000) occurs when MySQL uses show tables

Time:2020-12-1

1、 Problems arise

After installing mysql, when using show tables, error 1449 (HY000): the user specified as a definer appears all the time(‘ mysql.infoschema ‘@’localhost’) does not exist 。 Specific to the Internet search, the answer is to use mysql_ Upgrade, in fact, MySQL_ The upgrade function has been disabled after mysql8.0. After multi-party search, the following solutions are found.

mysql> use goblog
Database changed
mysql> show tables;
ERROR 1449 (HY000): The user specified as a definer ('mysql.infoschema'@'localhost') does not exist

2、 Solutions

The overall approach is to give mysql.infoschema Users add permissions.
After MySQL 8.0, it is not supported to create users implicitly when using grant. Users must be created first and then authorized. The code is as follows:

mysql> create user ' mysql.infoschema '@'% 'identified by' password ';
Query OK, 0 rows affected (0.01 sec)
mysql> create user ' mysql.infoschema '@'% 'identified by' password ';
Query OK, 0 rows affected (0.01 sec)
mysql> grant all privileges on *.* to 'mysql.infoschema'@'%';
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

Use show tables again, and the results will be displayed.

mysql> show tables;
+------------------+
| Tables_in_goblog |
+------------------+
| articles         |
+------------------+
1 row in set (0.01 sec)

This work adoptsCC agreementThe author and the link to this article must be indicated in the reprint

Recommended Today

Jhipster first installation tutorial

First of all, introduce myself, I am a third rate programmer, oh no, coder! Now I want to learn jhipster. Now I’m thinking about whether to analyze my own growth experience. I hope I can help you. I hope you can support me. Thank you! First of all, we need to eat first-hand resources and […]