473,769 Members | 6,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mysql console parsing error: 1064

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_captio n` tinytext NOT NULL,
-> `mytable_full_b ody` text NOT NULL,
-> PRIMARY KEY (`mytable_id`)
-> ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Testin g 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='Testin g 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

Jul 23 '05 #1
13 12239
>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?


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

Gordon L. Burditt
Jul 23 '05 #2
Gordon Burditt wrote:
A field of type 'text' is limited to 255 chars, I believe.


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.
Jul 23 '05 #3
wi*******@gmail .com wrote:
-> ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Testin g 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_captio n` tinytext NOT NULL,
`mytable_full_b ody` text NOT NULL,
PRIMARY KEY (`mytable_id`)
) ENGINE=MyISAM COMMENT='Testin g 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?


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
Jul 23 '05 #4
> 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.


Well, I think the trouble is elsewhere ..... when I try using another
example from the manual, it says the same thing!

mysql> CREATE TABLE federated_table (
-> id int(20) NOT NULL auto_increment,
-> name varchar(32) NOT NULL default '',
-> other int(20) NOT NULL default '0',
-> PRIMARY KEY (id),
-> KEY name (name),
-> KEY other_key (other)
-> )
-> ENGINE=FEDERATE D
-> DEFAULT CHARSET=latin1
-> COMMENT='mysql://root@remote_hos t:9306/federated/test_table';

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 u
se near 'FEDERATED
DEFAULT CHARSET=latin1
COMMENT='mysql://root@remote_h
Any comment?
TIA
--
Raqueeb Hassan
Bangladesh

Jul 23 '05 #5
Dear Aggro,

Thanks for the reply. Well, I think the trouble is elsewhere ..... when
I try using another example from the manual, it says the same thing!

mysql> CREATE TABLE federated_table (
-> id int(20) NOT NULL auto_increment,
-> name varchar(32) NOT NULL default '',
-> other int(20) NOT NULL default '0',
-> PRIMARY KEY (id),
-> KEY name (name),
-> KEY other_key (other)
-> )
-> ENGINE=FEDERATE D
-> DEFAULT CHARSET=latin1
-> COMMENT='mysql://root@remote_hos t:9306/federated/test_table';

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 'FEDERATED DEFAULT CHARSET=latin1
COMMENT='mysql://root@remote_h

mysql -u username -p databasename < queryfile.sql


So, I can use even multiple INSERTS from that queryfile.sql ...

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

TIA

--
Raqueeb Hassan
Bangladesh

Jul 23 '05 #6
Raqueeb Hassan wrote:
Thanks for the reply. Well, I think the trouble is elsewhere ..... when
I try using another example from the manual, it says the same thing! -> DEFAULT CHARSET=latin1
Of course it does, because this example has also CHARSET in it. Like I
said "If you remove the character set part, it should work". I'm pretty
sure your problem is that 4.0 doesn't support CHARSET for table. Upgrade
to 4.11 if you can and that should solve the problem.
So, I can use even multiple INSERTS from that queryfile.sql ...


Yes you can. I often use it to create databases, tables and insert data
to them. With mysqldump you can create a copy of your database(s) and
using the syntax above, you can then insert that data back to database.
But nothing stops you from writing the queries manually.
Jul 23 '05 #7
wi*******@gmail .com wrote:
-> ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Testin g Full


Check the syntax for 'table_option', on the web page:
http://dev.mysql.com/doc/mysql/en/create-table.html

The syntax you should use is:
DEFAULT CHARACTER SET latin1

Using the word CHARSET is not included in the syntax. Neither should
you use the "=" character.

Regards,
Bill K.
Jul 23 '05 #8
I double-checked the manual, and there are a couple of errors in the
docs regarding "CHARSET" versus "CHARACTER SET" syntax.

I've logged a doc bug with the MySQL website.

http://bugs.mysql.com/bug.php?id=11251

Regards,
Bill K.
Jul 23 '05 #9
Bill Karwin wrote:
Check the syntax for 'table_option', on the web page:
http://dev.mysql.com/doc/mysql/en/create-table.html

The syntax you should use is:
DEFAULT CHARACTER SET latin1


Did you actually test that it works on MySQL version 4.0? Because I
can't get it to work on my 4.0:

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_captio n` tinytext NOT NULL,
-> `mytable_full_b ody` text NOT NULL,
-> PRIMARY KEY (`mytable_id`)
-> ) ENGINE=MyISAM DEFAULT CHARACTER SET latin1;
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 CHARACTER SET latin1' at line 8
mysql>
# It only works without CHARACTER SET:

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_captio n` tinytext NOT NULL,
-> `mytable_full_b ody` text NOT NULL,
-> PRIMARY KEY (`mytable_id`)
-> ) ENGINE=MyISAM;
Query OK, 0 rows affected (0.01 sec)
Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4558
by: Kenneth Illingsworth | last post by:
--=_603E7359.5B3A569C Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I suspect that this is some kind of issue with privileges. However, the = account I am using has been given 'ALL' privileges to the database I am = trying to insert to. Am I save to assume that ALL includes insert = privileges?
0
654
by: Morten Gulbrandsen | last post by:
Hi programmers, I try to investigate some of the basics behind schemas and cataloges, Which is part of SQL2 Language this is the error message I get:
0
2983
by: Kenneth Illingsworth | last post by:
--=_603E7359.5B3A569C Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I suspect that this is some kind of issue with privileges. However, the = account I am using has been given 'ALL' privileges to the database I am = trying to insert to. Am I save to assume that ALL includes insert = privileges?
0
5004
by: Fatt Shin | last post by:
Hi, I'm running MySQL 4.0.13, connecting from PowerBuilder 9 using ODCB Connector 3.51. I'm facing a problem where whenever I issue a SELECT COUNT(*) statement from PowerBuilder, I always get SQL syntax error back from MySQL. (Refer to ODBC Trace I captured below). metrohouse af8-b94 ENTER SQLExecDirect HSTMT 014D2360 UCHAR * 0x020A0EA2 "select count ( *) from code
0
2369
by: Mario Ohnewald | last post by:
Hello! I want to import a MySQL 3.x Databse to my new shiny MySQL4.x. I did a backup with /usr/local/mysql-standard-4.0.14-pc-linux-i686/bin/mysqldump -u root -p --opt -A > mysql_lamp_backup.`date '+%Y.%m.%d'`.sql And i tried to import it to MySQL4.x with: /usr/local/mysql/bin/mysql -u root -p < mysqlbak The error: ERROR 1064 at line 598: You have an error in your SQL syntax. Check the
4
5853
by: Adam Smith | last post by:
I have a dedicated server running 'FreeBSD 4.9 STABLE' at a hosting site. They have done some default installations, presumably from the CVS ports package ??. Herein lies the problem, "I do not know" what they have done! At first it was apparent that MySQL was installed mysql_install_db ; GRANT TABLES etc. ??? so I ran "mysql_install_db --force"
3
2312
by: Thiagu.M | last post by:
Hi All i dont have much experience in databases or Mysql.i have my data in development m/c with Mysql 4.1.12, i have to move them to production m/c with Mysql 5.0.3 .when tried it showed error with displaying # mysql -u root mydatabase < backup1.sql ERROR 1064 (42000) at line 1: 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 'r o
39
5869
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f ISO-8859-1 -t UTF-8 mydb.sql mydb_utf8.sql mysqlCREATE DATABASE mydb_utf8 CHARACTER SET utf8 COLLATE utf8_general_ci;
1
4518
by: chromis | last post by:
Hi, I'm trying to import a mysqldump of all the databases from one server to another. First I attempted to use phpMyAdmin, I exported using the export to file option (drop database and drop tables selected) and then tryed to paste the resulting file (8mb into the text input field) not the brightest of moves i admit. That failing I then tryed this command from the command console (windows server 2003): C:\mysql\binmysql -u root -p <...
0
9590
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9424
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10223
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3968
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.