在做课程设计中遇到了一些错误于是在网上找资料解决
具体代码:
mysql> use mysql;
Database changed
mysql> show tables;
ERROR 1449 (HY000): The user specified as a definer ('mysql.infoschema'@'localhost') does not exist
mysql> drop user 'mysql.infoschema'@'localhost';
ERROR 1396 (HY000): Operation DROP USER failed for 'mysql.infoschema'@'localhost'
mysql> show tables;
ERROR 1449 (HY000): The user specified as a definer ('mysql.infoschema'@'localhost') does not exist
mysql> select user,host from user;
+--------------------------------+-----------+
| user | host |
+--------------------------------+-----------+
| 'mysql.infoschema'@'localhost' | localhost |
| root | localhost |
+--------------------------------+-----------+
2 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 1
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> create user 'mysql.infoschema'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.01 sec)
mysql> select user,host from user;
+--------------------------------+-----------+
| user | host |
+--------------------------------+-----------+
| 'mysql.infoschema'@'localhost' | localhost |
| mysql.infoschema | localhost |
| root | localhost |
+--------------------------------+-----------+
3 rows in set (0.00 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.02 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 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 |
| ndb_binlog_index |
| 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 |
+------------------------------------------------------+
38 rows in set (0.03 sec)
使用工具:
过程截图: