Closed liushuai05 closed 2 years ago
Creating tables with underscores works perfectly fine. The whitespaces (before and after) in the table name are the problem:
mysql> create database foo;
Query OK, 1 row affected (0.00 sec)
mysql> use foo;
Database changed
mysql> create table `foo_bar` (id int);
Query OK, 0 rows affected (0.03 sec)
mysql> create table ` foobar ` (id int);
ERROR 1103 (42000): Incorrect table name ' foobar '
Thank you very much for your patient answer. How to solve this problem? The same sql runs very well in phpmyadmin.
Just trim (remove whitespaces) the table name:
CREATE TABLE ` a_b `
should become
CREATE TABLE `a_b`
Just trim (remove whitespaces) the table name:
CREATE TABLE ` a_b `
should become
CREATE TABLE `a_b`
Thank you very much. This problem has been solved. I used another library, which resulted in the automatic addition of spaces between`a_b`
When creating a table, "Error: ER_WRONG_TABLE_NAME: incorrect table name' XXX'" will be mentioned when the table name is underlined.