我初学MYSQL, 在华军软件下的5.0.51a版本。装上后只有第一次成功创建一个tabel,之后的每一次都提示ERROR 1064 (42000)。重装后也从没创建成功。到底ERROR 1064 (42000)是什么?我哪里打错了?
mysql> create table dept
-> (
-> deptno int primary key,
-> dname varchar(14),
-> loc varchar(13),
-> );
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 ')' at
line 6mysql> create table dept
-> BEGIN
-> END;
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 'BEGINEND' at line 2
mysql> create table dept
-> (
-> deptno int primary key,
-> dname varchar(14),
-> loc varchar(13),
-> );
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 ')' at
line 6mysql> create table dept
-> BEGIN
-> END;
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 'BEGINEND' at line 2
解决方案 »
- mysql general_log的清除
- memcahced缓存MySQL数据困惑
- mysql 创建关联
- 如何才能做到过滤这个日志文件选择部分内容
- MYSQL难写的存储过程
- 数据库取值问题 急!~~~~~~~~~~~~
- mysql菜鸟问题,为什么我配置mysql数据库连接,总是连接不上?
- 请问phpmyadmin怎么使用(高分)
- 怎么新的MYSQL(3.23.51)不能直接拷贝数据库了?
- 关于建表结构的不解,求问!
- Powerdesigner 如何产生 Mysql 视图脚本?
- 高分!!!linux先忙mysql重启问题,报错:Starting MySQL../etc/init.d/mysql: line 159: kill: (4267) - No such process。
create table dept(deptno int primary key,dname varchar(14), loc varchar(13));
例如:
create database test1;
成功后,再使用该数据库才能进以下操作
语句为:
use test1;
再建表:如:
create table (name char(10),age int);
就可以了,
记着每次使用前都要
use test1; 哦!!
mysql> create table dept
-> (
-> deptno int primary key,
-> dname varchar(14),
-> loc varchar(13),
-> );
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 ')' a
line 6
mysql> create table dept
-> (
-> deptno int primary key,
-> dname varchar(14),
-> loc varchar(13)
-> );
Query OK, 0 rows affected (0.53 sec)
[/code]