MySQLHD 2019-04-02
代码如下:
mysql> USE innodb; mysql> DATABASE changed mysql> SHOW CREATE TABLE innodb; ERROR 1146 (42S02): TABLE 'innodb.innodb' doesn't exist
代码如下:
mysql> CREATE DATABASE tmp; mysql> CREATE TABLE innodb (`id` int(11) NOT NULL) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
代码如下:
mysql> SHOW CREATE TABLE innodb \G; *************************** 1. row ********** TABLE: innodb CREATE TABLE: CREATE TABLE `innodb` ( `dd` varchar(1) NOT NULL, `cc` varchar(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 1 row IN SET (0.00 sec) ERROR: No query specified mysql> INSERT INTO innodb (dd,cc) value (1,2); mysql> Query OK, 1 row affected (0.00 sec) mysql> SELECT * FROM innodb; ERROR 2013 (HY000): Lost connection TO MySQL server during query
代码如下:
mysql> USE tmp; mysql> SHOW CREATE TABLE test; ERROR 1017 (HY000): Can't find file: 'test' (errno: 2)
代码如下:
mysql> repair TABLE test USE_FRM; +------------------+--------+----------+----------+ | TABLE | Op | Msg_type | Msg_text | +------------------+--------+----------+----------+ | test.test_myisam | repair | STATUS | OK | +------------------+--------+----------+----------+ 1 row IN SET (0.00 sec) mysql> SHOW CREATE TABLE test \G; *************************** 1. row ********** TABLE: test CREATE TABLE: CREATE TABLE `test` ( `dd` varchar(1) NOT NULL, `cc` varchar(1) NOT NULL ) ENGINE=myisam DEFAULT CHARSET=utf8 1 row IN SET (0.00 sec) ERROR: No query specified mysql> INSERT INTO test (dd,cc) value(1,2); Query OK, 1 row affected (0.00 sec) mysql> SELECT * FROM test; +------+ | dd | cc +------+ | 1 |2 +------+ 1 row IN SET (0.00 sec)