Mysql控制台解析错误:1064 [英] Mysql console parsing error: 1064

查看:85
本文介绍了Mysql控制台解析错误:1064的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!


我知道这是愚蠢的,但是当在mysql(win32)中创建一个表
数据库时,它赢了不要让我创造这个mytable。这是我的

ER_PARSE_ERROR。


mysql> CREATE TABLE`mytable`(

- >`mytable_id` int(25)NOT NULL auto_increment,

- >`mytable_title` varchar(100)NOT NULL default' ''',

- >`mytable_dts` varchar(25)NOT NULL默认'''',

- >`mytable_caption` tinytext NOT NULL,

- >`mytable_full_body`文本NOT NULL,

- > PRIMARY KEY(`mytable_id`)

- >)ENGINE = MyISAM DEFAULT CHARSET = latin1评论=''测试完整

文本搜索功能。'';


错误1064:您的SQL语法有错误。查看与您的MySQL服务器版本对应的手册

以获得正确的语法

使用DEFAULT CHARSET = latin1评论=''测试全文搜索
Functi


同时插入粘贴到mysql

控制台的大文本时,只有几行可以到达那里。 />

INSERT INTO`mytable` VALUES(1,''Mozilla Firefox很酷!'',

''1111813200'',''Mozilla Firefox等等等等。 ...更多500字'');


我想,mysql控制台在输入时限制了大小。我是否需要编辑my.cnf文件?


你能指出我的目标吗?

mysql>状态

--------------

mysql Ver 12.22 Distrib 4.0.20a,for Win95 / Win98(i32)


TIA


-

Raqueeb Hassan

孟加拉国

Hello there!

I know it''s stupid, but when creating a table in a mysql (win32)
database, it won''t let me create this "mytable". Here goes my
ER_PARSE_ERROR.

mysql> CREATE TABLE `mytable` (
-> `mytable_id` int(25) NOT NULL auto_increment,
-> `mytable_title` varchar(100) NOT NULL default '''',
-> `mytable_dts` varchar(25) NOT NULL default '''',
-> `mytable_caption` tinytext NOT NULL,
-> `mytable_full_body` text NOT NULL,
-> PRIMARY KEY (`mytable_id`)
-> ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT=''Testing Full
Text Search Functionality.'';

ERROR 1064: 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 ''DEFAULT CHARSET=latin1 COMMENT=''Testing Full Text Search
Functi

At the same time while inserting a large text as pasted to mysql
console, only couple of lines gets there.

INSERT INTO `mytable` VALUES (1, ''Mozilla Firefox is Cool!'',
''1111813200'', ''Mozilla Firefox blah blah .... more 500 words '');

I guess, the mysql console is limiting the size while inputting. Do I
have to edit that my.cnf file?

Could you please point where am I heading?
mysql> status
--------------
mysql Ver 12.22 Distrib 4.0.20a, for Win95/Win98 (i32)

TIA

--
Raqueeb Hassan
Bangladesh

推荐答案

>同时插入粘贴到mysql
>At the same time while inserting a large text as pasted to mysql
控制台的大文本时,只有几行可以到达。<插入`mytable` VALUES(1,''Mozilla Firefox很酷!'','1111813200'',''Mozilla Firefox等等......更多500字' ');

我想,mysql控制台在输入时限制了大小。我是否必须编辑my.cnf文件?
console, only couple of lines gets there.

INSERT INTO `mytable` VALUES (1, ''Mozilla Firefox is Cool!'',
''1111813200'', ''Mozilla Firefox blah blah .... more 500 words '');

I guess, the mysql console is limiting the size while inputting. Do I
have to edit that my.cnf file?




我认为,''text''类型的字段限制为255个字符。 br />
这不是限制你的控制台。试试''longtext''。


Gordon L. Burditt



A field of type ''text'' is limited to 255 chars, I believe.
It''s not the console limiting you. Try ''longtext''.

Gordon L. Burditt


Gordon Burditt写道:
Gordon Burditt wrote:
文本类型的字段限制为255个字符,我相信。
A field of type ''text'' is limited to 255 chars, I believe.




这不是真的。文本字段可以容纳更多。我有

示例将大型网页的html代码保存到文本字段中。



That is not true. text field can hold a lot more than that. I have for
example saved html codes of large web pages into text fields.


wi ******* @ gmail.com 写道:
wi*******@gmail.com wrote:
- > )ENGINE = MyISAM DEFAULT CHARSET = latin1 COMMENT =''测试完全


改进了对字符集处理的支持在

版本4.1中添加到MySQL。这里描述的功能在MySQL中实现

4.1.1。 (MySQL 4.1.0有一些但不是所有这些功能,而且它们的一些实现方式不同。)
http://dev.mysql.com/doc/mysql/en/charset.html


如果你删除字符集部分,它应该工作(没有字符

设置):


CREATE TABLE`mytable` (

`mytable_id` int(25)NOT NULL auto_increment,

`mytable_title` varchar(100)NOT NULL默认'''',

`mytable_dts` varchar(25)NOT NULL默认'''',

`mytable_caption` tinytext NOT NULL,

`mytable_full_body` text NOT NULL,

PRIMARY KEY(`mytable_id`)

)ENGINE = MyISAM COMMENT =''测试完整

文本搜索功能。'';

同时插入粘贴到mysql
控制台的大文本时,只有几行可以到达。

INSERT INTO`mytable` VA LUES(1,''Mozilla Firefox酷!'','1111813200'',''Mozilla Firefox等等......更多500字'');

我猜测,mysql控制台在输入时限制了大小。我是否必须编辑my.cnf文件?
-> ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT=''Testing Full
"Improved support for character set handling was added to MySQL in
Version 4.1. The features described here are as implemented in MySQL
4.1.1. (MySQL 4.1.0 has some but not all of these features, and some of
them are implemented differently.)"
http://dev.mysql.com/doc/mysql/en/charset.html

If you remove the character set part, it should work (without character
set):

CREATE TABLE `mytable` (
`mytable_id` int(25) NOT NULL auto_increment,
`mytable_title` varchar(100) NOT NULL default '''',
`mytable_dts` varchar(25) NOT NULL default '''',
`mytable_caption` tinytext NOT NULL,
`mytable_full_body` text NOT NULL,
PRIMARY KEY (`mytable_id`)
) ENGINE=MyISAM COMMENT=''Testing Full
Text Search Functionality.'';
At the same time while inserting a large text as pasted to mysql
console, only couple of lines gets there.

INSERT INTO `mytable` VALUES (1, ''Mozilla Firefox is Cool!'',
''1111813200'', ''Mozilla Firefox blah blah .... more 500 words '');

I guess, the mysql console is limiting the size while inputting. Do I
have to edit that my.cnf file?




当我向数据库插入大量数据时,我经常保存插入

查询到文件然后调用:


mysql -u username -p databasename< queryfile.sql



When I insert large amounts of data to database I often save the insert
queries into file and then call:

mysql -u username -p databasename < queryfile.sql


这篇关于Mysql控制台解析错误:1064的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆