cl071997
asked on
error - default character set when loading a sql-fil creating tables...
Hi
Im trying to create a lot of tables by loading a sql-file. But each time it fails.
cat /create_itracker_core.sql | mysql itracker
ERROR 1064 at line 1: You have an error in your SQL syntax near 'CHARACTER SET utf8' at line 5
The file looks like:
create table IDSTORE (
id VARCHAR(80) PRIMARY KEY,
name VARCHAR(80) UNIQUE,
last_id VARCHAR(255)
) DEFAULT CHARACTER SET utf8;
If I remove the "DEFAULT CHARACTER SET utf8;" it works fine.
My /etc/my.cnf:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysq l.sock
[mysql.server]
user=mysql
basedir=/var/lib
# set-variable = default-character-set=utf8 # I have tried with this line enabled too..
[safe_mysqld]
err-log=/var/log/mysqld.lo g
pid-file=/var/run/mysqld/m ysqld.pid
Im running on Linux Redhat 8
Regards
Claes
Im trying to create a lot of tables by loading a sql-file. But each time it fails.
cat /create_itracker_core.sql | mysql itracker
ERROR 1064 at line 1: You have an error in your SQL syntax near 'CHARACTER SET utf8' at line 5
The file looks like:
create table IDSTORE (
id VARCHAR(80) PRIMARY KEY,
name VARCHAR(80) UNIQUE,
last_id VARCHAR(255)
) DEFAULT CHARACTER SET utf8;
If I remove the "DEFAULT CHARACTER SET utf8;" it works fine.
My /etc/my.cnf:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysq
[mysql.server]
user=mysql
basedir=/var/lib
# set-variable = default-character-set=utf8
[safe_mysqld]
err-log=/var/log/mysqld.lo
pid-file=/var/run/mysqld/m
Im running on Linux Redhat 8
Regards
Claes
ASKER
I see. I tried to load the tables without the "DEFAULT CHARACTER SET" and it worked fine.
But dont I need the character set when creating the tables?
Or can it be solved in my.cnf ?
Regards
Claes
But dont I need the character set when creating the tables?
Or can it be solved in my.cnf ?
Regards
Claes
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK.
Its up and running now and we will find out if the default character set is needed or not.
Many thanks for you help.
Regards
Claes
Its up and running now and we will find out if the default character set is needed or not.
Many thanks for you help.
Regards
Claes
When I upgraded from 3.23 to 4.1 I had the same problem.
I solved it by deleting all the DEFAULT CHARSET commands with a SED script.