小弟今天早上心血来潮想学学数据库,然后看了看mysql。现在的问题是我想给一个数据库里边加张表咋弄都成功不了。
比如这样:首先进去数据库。 然后 show databases; 有三个 然后 use test;显示Database changed 然后再 show tables; 显示 Empty set(0.00sec) 然后我就 create table (id int not null,name varchar not null);
它就显示错误!!!!!! Why???????
比如这样:首先进去数据库。 然后 show databases; 有三个 然后 use test;显示Database changed 然后再 show tables; 显示 Empty set(0.00sec) 然后我就 create table (id int not null,name varchar not null);
它就显示错误!!!!!! Why???????
解决方案 »
- 请问如何给mysql建立连接池以及索引?
- 关于存储过程的输出参数类型的问题
- 求一条 distinct group by 语句
- mysql 函数怎么返回一个表
- phpmyadmin提示:使用链接表的额外特性尚未激活。要查出原因,请单击此处。
- 一个小问题 我把access导入到mysql里面,show列名 不能用好象因为是保留字吧,怎么解决呢,可以我的表名type也是保留字,可以用列
- sql语句不会,求一sql
- 关于net start mysql 与mysql-nt-max --install 的关系
- 求一条sql语句
- CentOS6.5把MySQL从5.1升级到5.6后,MySQL不能启动
- 向mysql数据库插入数据异常
- 数据库mysql锁表问题
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.02 sec)mysql> use test
Database changed
mysql> show tables;
Empty set (0.00 sec)mysql> create table(id int not null, name varchar not null);
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 '(id i
nt not null, name varchar not null)' at line 1
mysql>
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 'use (
id int not null, name varchar not null)' at line 1
mysql>
Query OK, 0 rows affected (0.06 sec)但是能告诉我为什么你的就能成功吗 我这本破书上也没说有什么规则呀
+----------------+
| Tables_in_test |
+----------------+
| use |
+----------------+
1 row in set (0.00 sec)mysql> drop table use;
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 'use'
at line 1
mysql>
又删除不成了??????