求解答
刚刚安装的MySQL 8.0.16版本 创建了一个新的数据库和新的表,show tables显示表已存在,但是select查询或desc都显示表不存在
Server version: 8.0.16 MySQL Community Server
系统MacOS
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| e |
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)
mysql> create database t;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE TABLE ‘test_0’(
-> ‘id’ int(11) unsigned NOT NULL AUTO_INCREMENT,
-> ‘name’ varchar(80) NOT NULL,
-> PRIMARY KEY (‘id’)
-> );
ERROR 1046 (3D000): No database selected
mysql> use t
Database changed
mysql> CREATE TABLE ‘test_0’(
-> ‘id’ int(11) unsigned NOT NULL AUTO_INCREMENT,
-> ‘name’ varchar(80) NOT NULL,
-> PRIMARY KEY (‘id’)
-> );
Query OK, 0 rows affected (0.02 sec)
mysql> show tables;
+--------------+
| Tables_in_t |
+--------------+
| ‘test_0’ |
+--------------+
1 row in set (0.00 sec)
mysql> desc test_0;
ERROR 1146 (42S02): Table 't.test_0' doesn't exist
mysql>