
but I used NetBeans,then I can create table user.

User is a Keyword. If you want to use as Tablename you must put it in backticks like.
CREATE TABLE `user` ( ....
sample
mysql> CREATE TABLE `user` (
-> `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
-> `userName` varchar(32) DEFAULT NULL,
-> `password` varchar(32) DEFAULT NULL,
-> `realName` varchar(32) DEFAULT NULL,
-> PRIMARY KEY (`id`)
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0,02 sec)
mysql> insert into `user` (id) VALUE (99);
Query OK, 1 row affected (0,00 sec)
mysql> select * from `user`;
+----+----------+----------+----------+
| id | userName | password | realName |
+----+----------+----------+----------+
| 99 | NULL | NULL | NULL |
+----+----------+----------+----------+
1 row in set (0,00 sec)
mysql>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With