This is a discussion on newbie: syntax error in CREATE TABLE within the MySQL forums, part of the Database Server Software category; --> Hello, I have installed MySQL, MySQL Administrator and MySQL QueryBrowser. I try to create table with MySQL Administrator entering ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello, I have installed MySQL, MySQL Administrator and MySQL QueryBrowser. I try to create table with MySQL Administrator entering table and column data. MySQL Administrator generated SQL: CREATE TABLE `rozgloszenia`.`clients` ( `client_id` INTEGER UNSIGNED CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AUTO_INCREMENT COMMENT 'Numer klienta', `name` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'Nazwa', `email` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT 'E-mail', `phone` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT 'Telefon', `town` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'Miejscowość', PRIMARY KEY (`client_id`) ) ENGINE = MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Nasi klienci'; The problem is that when I accept this SQL in MySQL Administrator I receive error: Error executing SQL commands to create table. MySQL Error Nr. 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 'CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AUTO_INCREMENT COMMENT 'Nume' at line 2 I don't know what is wrong. BTW, where I can find error descriptions by error codes? /RAM/ |
| |||
| r_ahimsa_m@poczta.onet.pl wrote: > Hello, > I have installed MySQL, MySQL Administrator and MySQL QueryBrowser. I try to > create table with MySQL Administrator entering table and column data. MySQL > Administrator generated SQL: > > CREATE TABLE `rozgloszenia`.`clients` ( > `client_id` INTEGER UNSIGNED CHARACTER SET utf8 COLLATE utf8_general_ci > NOT NULL AUTO_INCREMENT COMMENT 'Numer klienta', > The problem is that when I accept this SQL in MySQL Administrator I receive > error: > > Error executing SQL commands to create table. > MySQL Error Nr. 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 'CHARACTER SET > utf8 COLLATE utf8_general_ci NOT NULL AUTO_INCREMENT COMMENT 'Nume' at line > 2 > > I don't know what is wrong. An INT column cannot have a character set AFAIK. if MySQL administrator actually generates this, I'd suggest filing a bug report. > BTW, where I can find error descriptions by error codes? Someone invented a very handy service on the internet: http://www.google.nl/search?q=mysql+error+codes -- Rik Wasmus ....spamrun finished |
| ||||
| On Wed, 28 May 2008 13:22:19 +0200, r_ahimsa_m@poczta.onet.pl wrote: > Hello, > I have installed MySQL, MySQL Administrator and MySQL QueryBrowser. I try to > create table with MySQL Administrator entering table and column data. MySQL > Administrator generated SQL: > > CREATE TABLE `rozgloszenia`.`clients` ( > `client_id` INTEGER UNSIGNED CHARACTER SET utf8 COLLATE utf8_general_ci > NOT NULL AUTO_INCREMENT COMMENT 'Numer klienta', > `name` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL > COMMENT 'Nazwa', > `email` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_general_ci > COMMENT 'E-mail', > `phone` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci > COMMENT 'Telefon', > `town` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL > COMMENT 'Miejscowo??', > PRIMARY KEY (`client_id`) > ) > ENGINE = MyISAM > CHARACTER SET utf8 COLLATE utf8_general_ci > COMMENT = 'Nasi klienci'; > > The problem is that when I accept this SQL in MySQL Administrator I receive > error: > > Error executing SQL commands to create table. > MySQL Error Nr. 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 'CHARACTER SET > utf8 COLLATE utf8_general_ci NOT NULL AUTO_INCREMENT COMMENT 'Nume' at line > 2 > > I don't know what is wrong. INTEGER doesn't take a CHARACTER SET. Nor a COLLATion. Though it would be funny to see a 7 with an umlaut. -- 6. I will not gloat over my enemies' predicament before killing them. --Peter Anspach's list of things to do as an Evil Overlord |