我初学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 Incorrect number of arguments for PROCEDURE
- mysql怎么加密密码?
- 问下这个sql 有办法优化么。。。
- 如何通过MYSQL连接MSSQL数据库?
- 急!菜鸟问一个关于mysql配置的简单问题,大家帮忙啊!
- mysql有什么数据类型可以存入长度为4000的字符串???(在线等,马上给分)
- 怎么查询某表所有指定字符开头的数据
- 关于使用ADO操作mysql数据库的问题,程序运行一天后操作数据库就失败!
- Mysql,10W条随机批量插入(数据内容为字母和数字组合)
- 后面的字段值被前一个字段值被覆盖
- 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]