I got into the following trouble when installing LXR 0.9.5 with MySQL 5.x
mysql> \. initdb-mysql
then some errors were occurred.
What can I deal with the problem?
create table lxr_releases (
fileid int not null references lxr_files,
release char(255) binary not null,
primary key (fileid,release)
);
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 'release char(255) binary not null,
primary key (fileid,release)
' at line 3
Any helps would be appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I got into the following trouble when installing LXR 0.9.5 with MySQL 5.x
mysql> \. initdb-mysql
then some errors were occurred.
What can I deal with the problem?
create table lxr_releases (
fileid int not null references lxr_files,
release char(255) binary not null,
primary key (fileid,release)
);
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 'release char(255) binary not null,
primary key (fileid,release)
' at line 3
Any helps would be appreciated.
I fixed the MySQL 5.x problems by quoting the release identifier and telling MySQL to use ANSI-style quoting:
set session sql_mode='ANSI_QUOTES'
create table lxr_releases
(fileid int not null references lxr_files,
"release" char(255) binary not null,
primary key (fileid,"release")
);
You also have to modify lib/LXR/Index/Mysql.pm to set the sql_mode and to use SQL with the quoted release identifier.