couldn't make a table on MySQL 5.x?

Help
UnclePark
2006-05-04
2013-01-02
  • UnclePark

    UnclePark - 2006-05-04

    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.

     
    • Paul Boddie

      Paul Boddie - 2006-06-14

      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.

       

Log in to post a comment.