Bug #15965 SQL Syntax Error when piping fill_help_tables.sql into mysqld
Submitted: 23 Dec 2005 14:17 Modified: 26 Jan 2006 0:36
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:4.1.16, 4.1.16-1 OS:Linux (Linux)
Assigned to: Kent Boortz CPU Architecture:Any

[23 Dec 2005 14:17] [ name withheld ]
Description:
If I run mysql_install_db I get the following error:
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 '' at line 1
051223 15:17:14 [ERROR] Aborting

051223 15:17:14 [Note] /usr/sbin/mysqld: Shutdown complete

/usr/bin/mysql_install_db: line 309: 16576 Broken pipe             cat $fill_help_tables

WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!
The "HELP" command might not work properly

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h avlinux password 'new-password'
See the manual for more instructions.

NOTE:  If you are upgrading from a MySQL <= 3.22.10 you should run
the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com

How to repeat:
run: su - mysql -c "mysql_install_db --rpm --user=mysql"

Suggested fix:
none
[23 Dec 2005 14:43] Valeriy Kravchuk
Thank you for a problem report. Please, describe exactly what tar.gz package (RPM) you had downloaded and how you installed it.
[23 Dec 2005 14:58] [ name withheld ]
I downloaded the source tarball (http://dev.mysql.com/get/Downloads/MySQL-4.1/mysql-4.1.16.tar.gz/from/pick).
I build my own RPM-Package, based on an (customized) old Mandriva .SPEC-File (do you need my spec-file?).

Configure-Params:
--prefix=/ \
    --exec-prefix=%{_prefix} \
    --libexecdir=%{_sbindir} \
    --libdir=%{_libdir} \
    --sysconfdir=%{_sysconfdir} \
    --datadir=%{_datadir} \
    --localstatedir=%{_localstatedir}/mysql \
    --infodir=%{_infodir} \
    --includedir=%{_includedir} \
    --mandir=%{_mandir} \
    --enable-shared \
    --with-extra-charsets=complex \
    --enable-assembler \
    --enable-local-infile \
    --enable-large-files=yes \
    --enable-largefile=yes \
    --without-readline \
    --without-libwrap \
    --without-mysqlfs \
    --with-openssl \
    --without-berkeley-db \
    --without-debug \
    --with-big-tables \
    --with-collation=latin1_german2_ci \
    --with-mysqld-user=mysql \
    --with-unix-socket-path=%{_localstatedir}/mysql/mysql.sock" \
    --enable-thread-safe-client \
    --without-embedded-server \
    --without-innodb \
    --with-vio

gcc 4.0.2

make tests: all tests passed, but mysql_client_test failed
[23 Dec 2005 14:59] [ name withheld ]
I updated my old RPM-Package (via rpm -Fhv *.rpm) as I did before (I do so since 4.1.9)
[26 Dec 2005 15:43] Valeriy Kravchuk
Please, send the content of your share/mysql/fill_help_tables.sql file.
[26 Dec 2005 19:03] Jordan Russell
I get the same error message with the official 4.1.16-1.rhel3 packages. I have not modified fill_help_tables.sql in any way.

# rpm -qa | grep -i mysql
MySQL-client-standard-4.1.16-1.rhel3
MySQL-shared-standard-4.1.16-1.rhel3
MySQL-devel-standard-4.1.16-1.rhel3
MySQL-server-standard-4.1.16-1.rhel3

# mysql_install_db
Installing all prepared tables
Fill help tables
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 '' at line 1
051226 12:53:51 [ERROR] Aborting

051226 12:53:51 [Note] /usr/sbin/mysqld: Shutdown complete

/usr/bin/mysql_install_db: line 299: 10322 Broken pipe             cat $fill_help_tables

WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!
The "HELP" command might not work properly
[26 Dec 2005 20:41] [ name withheld ]
If I do
$ mysql -p
and then:
use mysql;
. /shared/mysql/fill_help_tables.sql

no error occurs, shall I submit my sql-file anyway?
[28 Dec 2005 7:50] Valeriy Kravchuk
Thank you for a bug report. Verified just as described with MySQL-server-4.1.16-1.glibc23.i386.rpm (for example) on Fedora Core Linux.

[root@Fedora tmp]# rpm -i MySQL-server-4.1.16-1.glibc23.i386.rpm
warning: MySQL-server-4.1.16-1.glibc23.i386.rpm: V3 DSA signature: NOKEY, key ID 
 5072e1f5
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 '' at line 1
051228 10:42:29 [ERROR] Aborting

051228 10:42:29 [Note] /usr/sbin/mysqld: Shutdown complete

/usr/bin/mysql_install_db: line 299:  1464 Broken pipe             cat $fill_help_tables

WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!
The "HELP" command might not work properly

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h Fedora password 'new-password'
See the manual for more instructions.

NOTE:  If you are upgrading from a MySQL <= 3.22.10 you should run
the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com
Starting MySQL. SUCCESS!
[28 Dec 2005 8:46] Juan Carlos Barranco
i had the same problem whit fedora core 4.  I have tried with these two packages :
mysql-5.1.4-alpha.tar.gz and mysql-max-5.1.4-alpha-linux-i686-glibc23.tar.gz and this mysql-max-5.1.4-alpha-linux-i686-glibc23.tar.tar is corrupted.
[28 Dec 2005 13:20] Kent Boortz
This is likely a duplicate of bug#15151
[19 Jan 2006 22:25] Ivan Lezhnev, Jr.
I face exactly the same problem trying to run /usr/bin/mysql_install_db.

Some brief info on my system and install configuration:

Linux distribution: Slackware 10.2.0
gcc-3.3.6
make-3.80

Source tarball: http://mirror.switch.ch/ftp/mirror/mysql/Downloads/MySQL-4.1/mysql-4.1.16.tar.gz

Configure parameters:
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mysql --enable-assembler --with-mysqld-ldflags=-all-static --with-unix-socket-path=/var/run/mysql/mysql.sock --with-extra-charsets=all

further steps:

- make
- make install
- cp support-files/my-medium.cnf /etc/my.cnf
- /usr/bin/mysql_install_db

which results into this message:

Installing all prepared tables
Fill help tables
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 '' at line 1
060120  0:24:56 [ERROR] Aborting

060120  0:24:56 [Note] ./bin/mysqld: Shutdown complete

./scripts/mysql_install_db: line 299:  5105 Broken pipe             cat $fill_help_tables

WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!
The "HELP" command might not work properly

I also tried the standard binary version of 4.1.16, but it doesn't really matter whether you compile from source or use precompiled version.
[20 Jan 2006 8:44] Ivan Lezhnev, Jr.
Btw, I've just succesfully comipled, installed and got running 4.1.15 with the same configuration options on the same platform.

Thus, some people report that they installed smoothly mysql-standard-4.1.16-pc-linux-gnu-i686-glibc23.tar.gz and mysql_install_db script works correctly on the Slackware system, but for me.

Waiting for the bugfix.
Thank you all for you job!
[20 Jan 2006 8:50] Lenz Grimmer
Could someone of you who experiences the problem please attach the output of "sh -x mysql_install_db 2>&1"? I'd like to see more details about what's going on there Thanks!
[20 Jan 2006 10:54] Patricia Rodriguez-Tomé
Here is my sh -x

$  sh -x mysql_install_db
+ in_rpm=0
+ windows=0
+ defaults=
+ user=
+ case "$1" in
+ test -x ./bin/my_print_defaults
+ test -x ./extra/my_print_defaults
+ test -x /usr/bin/my_print_defaults
+ print_defaults=/usr/bin/my_print_defaults
+ args=
+ ldata=
+ execdir=
+ bindir=
+ basedir=
+ force=0
+ verbose=0
+ fill_help_tables=
++ /usr/bin/my_print_defaults mysqld mysql_install_db
+ parse_arguments --datadir=/storage/bioinfo/lib/mysql --socket=/var/lib/mysql/mysql.sock --old_passwords=0
+ pick_args=
+ test --datadir=/storage/bioinfo/lib/mysql = PICK-ARGS-FROM-ARGV
+ for arg in '"$@"'
+ case "$arg" in
++ echo --datadir=/storage/bioinfo/lib/mysql
++ sed -e 's/^[^=]*=//'
+ ldata=/storage/bioinfo/lib/mysql
+ for arg in '"$@"'
+ case "$arg" in
+ test -n ''
+ for arg in '"$@"'
+ case "$arg" in
+ test -n ''
+ parse_arguments PICK-ARGS-FROM-ARGV
+ pick_args=
+ test PICK-ARGS-FROM-ARGV = PICK-ARGS-FROM-ARGV
+ pick_args=1
+ shift
+ test -z /storage/bioinfo/lib/mysql
+ test -z ''
+ basedir=/usr
+ bindir=/usr/bin
+ execdir=/usr/libexec
+ pkgdatadir=/usr/share/mysql
++ pwd
++ pwd
+ for i in '$basedir/support-files' '$basedir/share' '$basedir/share/mysql' '$basedir/scripts' '`pwd`' '`pwd`/scripts' /usr/share/mysql
+ test -f /usr/support-files/fill_help_tables.sql
+ for i in '$basedir/support-files' '$basedir/share' '$basedir/share/mysql' '$basedir/scripts' '`pwd`' '`pwd`/scripts' /usr/share/mysql
+ test -f /usr/share/fill_help_tables.sql
+ for i in '$basedir/support-files' '$basedir/share' '$basedir/share/mysql' '$basedir/scripts' '`pwd`' '`pwd`/scripts' /usr/share/mysql
+ test -f /usr/share/mysql/fill_help_tables.sql
+ pkgdatadir=/usr/share/mysql
+ for i in '$basedir/support-files' '$basedir/share' '$basedir/share/mysql' '$basedir/scripts' '`pwd`' '`pwd`/scripts' /usr/share/mysql
+ test -f /usr/scripts/fill_help_tables.sql
+ for i in '$basedir/support-files' '$basedir/share' '$basedir/share/mysql' '$basedir/scripts' '`pwd`' '`pwd`/scripts' /usr/share/mysql
+ test -f /u/xxx/fill_help_tables.sql
+ for i in '$basedir/support-files' '$basedir/share' '$basedir/share/mysql' '$basedir/scripts' '`pwd`' '`pwd`/scripts' /usr/share/mysql
+ test -f /u/xxx/scripts/fill_help_tables.sql
+ for i in '$basedir/support-files' '$basedir/share' '$basedir/share/mysql' '$basedir/scripts' '`pwd`' '`pwd`/scripts' /usr/share/mysql
+ test -f /usr/share/mysql/fill_help_tables.sql
+ pkgdatadir=/usr/share/mysql
+ test -f /usr/share/mysql/fill_help_tables.sql
+ fill_help_tables=/usr/share/mysql/fill_help_tables.sql
+ mdata=/storage/bioinfo/lib/mysql/mysql
+ mysqld=/usr/libexec/mysqld
+ mysqld_opt=
+ scriptdir=/usr/bin
+ test 0 = 1
+ test '!' -x /usr/libexec/mysqld
++ /bin/hostname
+ hostname=oxxx
+ test 0 = 0 -a 0 = 0 -a 0 = 0
++ /usr/bin/resolveip xxx
+ resolved='IP address of xxx is 127.0.0.1'
+ '[' 0 -ne 0 ']'
+ test '' = 1
+ test '!' -d /storage/bioinfo/lib/mysql
+ test '!' -d /storage/bioinfo/lib/mysql/mysql
+ test '!' -d /storage/bioinfo/lib/mysql/test
+ test -w / -a '!' -z ''
+ test '!' -f /storage/bioinfo/lib/mysql/mysql/db.frm
+ test 0 = 1
+ create_option=real
+ test -n ''
+ test 0 -eq 0 -a 0 -eq 0
+ echo 'Installing all prepared tables'
Installing all prepared tables
+ mysqld_install_cmd_line='/usr/libexec/mysqld   --bootstrap --skip-grant-tables --basedir=/usr --datadir=/storage/bioinfo/lib/mysql --skip-innodb --skip-bdb --skip-ndbcluster  --max_allowed_packet=8M --net_buffer_length=16K'
+ /usr/bin/mysql_create_system_tables real /storage/bioinfo/lib/mysql/mysql xxx.xxx.xxx 0
+ eval '/usr/libexec/mysqld   --bootstrap --skip-grant-tables --basedir=/usr --datadir=/storage/bioinfo/lib/mysql --skip-innodb --skip-bdb --skip-ndbcluster  --max_allowed_packet=8M --net_buffer_length=16K'
++ /usr/libexec/mysqld --bootstrap --skip-grant-tables --basedir=/usr --datadir=/storage/bioinfo/lib/mysql --skip-innodb --skip-bdb --skip-ndbcluster --max_allowed_packet=8M --net_buffer_length=16K
+ test -n /usr/share/mysql/fill_help_tables.sql
+ test 0 -eq 0 -a 0 -eq 0
+ echo 'Fill help tables'
Fill help tables
+ echo 'use mysql;'
+ cat /usr/share/mysql/fill_help_tables.sql
+ eval '/usr/libexec/mysqld   --bootstrap --skip-grant-tables --basedir=/usr --datadir=/storage/bioinfo/lib/mysql --skip-innodb --skip-bdb --skip-ndbcluster  --max_allowed_packet=8M --net_buffer_length=16K'
++ /usr/libexec/mysqld --bootstrap --skip-grant-tables --basedir=/usr --datadir=/storage/bioinfo/lib/mysql --skip-innodb --skip-bdb --skip-ndbcluster --max_allowed_packet=8M --net_buffer_length=16K
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 '' at line 1
060120 12:43:17 [ERROR] Aborting

060120 12:43:17 [Note] /usr/libexec/mysqld: Shutdown complete
[20 Jan 2006 22:54] Pedro Fortuna
+ in_rpm=0
+ windows=0
+ defaults=
+ user=
+ test -x ./bin/my_print_defaults
+ print_defaults=./bin/my_print_defaults
+ args=
+ ldata=
+ execdir=
+ bindir=
+ basedir=
+ force=0
+ verbose=0
+ fill_help_tables=
++ ./bin/my_print_defaults mysqld mysql_install_db
+ parse_arguments --port=3306 --socket=/tmp/mysql.sock --skip-locking --key_buffer=16M --max_allowed_packet=1M --tab
le_cache=64 --sort_buffer_size=512K --net_buffer_length=8K --read_buffer_size=256K --read_rnd_buffer_size=512K --myi
sam_sort_buffer_size=8M --log-bin --server-id=1
+ pick_args=
+ test --port=3306 = PICK-ARGS-FROM-ARGV
+ test -n ''
+ test -n ''
+ test -n ''
+ test -n ''
+ test -n ''
+ test -n ''
+ test -n ''
+ test -n ''
+ test -n ''
+ test -n ''
+ test -n ''
+ test -n ''
+ test -n ''
+ parse_arguments PICK-ARGS-FROM-ARGV --user=mysql
+ pick_args=
+ test PICK-ARGS-FROM-ARGV = PICK-ARGS-FROM-ARGV
+ pick_args=1
+ shift
++ echo --user=mysql
++ sed -e 's/^[^=]*=//'
+ user=mysql
+ test -z ''
+ ldata=/usr/local/mysql//var
+ test -z ''
+ basedir=/usr/local/mysql/
+ bindir=/usr/local/mysql//bin
+ execdir=/usr/local/mysql//libexec
+ pkgdatadir=/usr/local/mysql//share/mysql
++ pwd
++ pwd
+ test -f /usr/local/mysql//support-files/fill_help_tables.sql
+ test -f /usr/local/mysql//share/fill_help_tables.sql
+ test -f /usr/local/mysql//share/mysql/fill_help_tables.sql
+ pkgdatadir=/usr/local/mysql//share/mysql
+ test -f /usr/local/mysql//scripts/fill_help_tables.sql
+ test -f /usr/local/mysql/fill_help_tables.sql
+ test -f /usr/local/mysql/scripts/fill_help_tables.sql
+ test -f /usr/local/mysql//share/mysql/fill_help_tables.sql
+ pkgdatadir=/usr/local/mysql//share/mysql
+ test -f /usr/local/mysql//share/mysql/fill_help_tables.sql
+ fill_help_tables=/usr/local/mysql//share/mysql/fill_help_tables.sql
+ mdata=/usr/local/mysql//var/mysql
+ mysqld=/usr/local/mysql//libexec/mysqld
+ mysqld_opt=
+ scriptdir=/usr/local/mysql//bin
+ test 0 = 1
+ test '!' -x /usr/local/mysql//libexec/mysqld
++ /bin/hostname
+ hostname=foo.fooserver.com
+ test 0 = 0 -a 0 = 0 -a 0 = 0
++ /usr/local/mysql//bin/resolveip foo.fooserver.com
+ resolved=IP address of foo.fooserver.com is 192.168.100.1
+ '[' 0 -ne 0 ']'
+ test '' = 1
+ test '!' -d /usr/local/mysql//var
+ test '!' -d /usr/local/mysql//var/mysql
+ test '!' -d /usr/local/mysql//var/test
+ test -w / -a '!' -z mysql
+ chown mysql /usr/local/mysql//var /usr/local/mysql//var/mysql /usr/local/mysql//var/test
+ test '!' -f /usr/local/mysql//var/mysql/db.frm
+ test 0 = 1
+ create_option=real
+ test -n mysql
+ args= --user=mysql
+ test 0 -eq 0 -a 0 -eq 0
+ echo 'Installing all prepared tables'
Installing all prepared tables
+ mysqld_install_cmd_line=/usr/local/mysql//libexec/mysqld   --bootstrap --skip-grant-tables --basedir=/usr/local/my
sql/ --datadir=/usr/local/mysql//var --skip-innodb --skip-bdb --skip-ndbcluster  --user=mysql --max_allowed_packet=8
M --net_buffer_length=16K
+ /usr/local/mysql//bin/mysql_create_system_tables real /usr/local/mysql//var/mysql tech.particuladigital.com 0
+ eval '/usr/local/mysql//libexec/mysqld   --bootstrap --skip-grant-tables --basedir=/usr/local/mysql/ --datadir=/us
r/local/mysql//var --skip-innodb --skip-bdb --skip-ndbcluster  --user=mysql --max_allowed_packet=8M --net_buffer_len
gth=16K'
++ /usr/local/mysql//libexec/mysqld --bootstrap --skip-grant-tables --basedir=/usr/local/mysql/ --datadir=/usr/local
/mysql//var --skip-innodb --skip-bdb --skip-ndbcluster --user=mysql --max_allowed_packet=8M --net_buffer_length=16K
+ test -n /usr/local/mysql//share/mysql/fill_help_tables.sql
+ test 0 -eq 0 -a 0 -eq 0
+ echo 'Fill help tables'
Fill help tables
+ echo 'use mysql;'
+ cat /usr/local/mysql//share/mysql/fill_help_tables.sql
+ eval '/usr/local/mysql//libexec/mysqld   --bootstrap --skip-grant-tables --basedir=/usr/local/mysql/ --datadir=/us
r/local/mysql//var --skip-innodb --skip-bdb --skip-ndbcluster  --user=mysql --max_allowed_packet=8M --net_buffer_len
gth=16K'
++ /usr/local/mysql//libexec/mysqld --bootstrap --skip-grant-tables --basedir=/usr/local/mysql/ --datadir=/usr/local
/mysql//var --skip-innodb --skip-bdb --skip-ndbcluster --user=mysql --max_allowed_packet=8M --net_buffer_length=16K
ERROR: 1064  You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version fo
r the right syntax to use near '' at line 1
060120 22:51:38 [ERROR] Aborting

060120 22:51:38 [Note] /usr/local/mysql//libexec/mysqld: Shutdown complete

bin/mysql_install_db: line 299: 19857 Broken pipe             cat $fill_help_tables
+ res=1
+ test 1 '!=' 0
+ echo ''

+ echo 'WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!'
WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!
+ echo 'The "HELP" command might not work properly'
The "HELP" command might not work properly
+ echo ''

+ test 0 = 0 -a 0 = 0
+ echo ''

+ echo 'To start mysqld at boot time you have to copy support-files/mysql.server'
To start mysqld at boot time you have to copy support-files/mysql.server
+ echo 'to the right place for your system'
to the right place for your system
+ echo

+ test 0 -eq 0
+ echo 'PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !'
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
+ echo 'To do so, start the server, then issue the following commands:'
To do so, start the server, then issue the following commands:
+ echo '/usr/local/mysql//bin/mysqladmin -u root password '\''new-password'\'''
/usr/local/mysql//bin/mysqladmin -u root password 'new-password'
+ echo '/usr/local/mysql//bin/mysqladmin -u root -h tech.particuladigital.com password '\''new-password'\'''
/usr/local/mysql//bin/mysqladmin -u root -h tech.particuladigital.com password 'new-password'
+ echo 'See the manual for more instructions.'
See the manual for more instructions.
+ test -z ''
+ echo

+ echo 'NOTE:  If you are upgrading from a MySQL <= 3.22.10 you should run'
NOTE:  If you are upgrading from a MySQL <= 3.22.10 you should run
+ echo 'the /usr/local/mysql//bin/mysql_fix_privilege_tables. Otherwise you will not be'
the /usr/local/mysql//bin/mysql_fix_privilege_tables. Otherwise you will not be
+ echo 'able to use the new GRANT command!'
able to use the new GRANT command!
+ echo

+ test 0 = 0
+ echo 'You can start the MySQL daemon with:'
You can start the MySQL daemon with:
+ echo 'cd /usr/local/mysql/ ; /usr/local/mysql//bin/mysqld_safe &'
cd /usr/local/mysql/ ; /usr/local/mysql//bin/mysqld_safe &
+ echo

+ echo 'You can test the MySQL daemon with the benchmarks in the '\''sql-bench'\'' directory:'
You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
+ echo 'cd sql-bench ; perl run-all-tests'
cd sql-bench ; perl run-all-tests
+ echo

+ echo 'Please report any problems with the /usr/local/mysql//bin/mysqlbug script!'
Please report any problems with the /usr/local/mysql//bin/mysqlbug script!
+ echo

+ echo 'The latest information about MySQL is available on the web at'
The latest information about MySQL is available on the web at
+ echo http://www.mysql.com
http://www.mysql.com
+ echo 'Support MySQL by buying support/licenses at https://order.mysql.com'
Support MySQL by buying support/licenses at https://order.mysql.com
+ exit 0
[25 Jan 2006 9:43] Lenz Grimmer
Sorry, this is beyond me. It actually seems to be a server bug.
Reading the fill_help_tables.sql file using the "mysql" client works fine:

[SNIP]
lenz@metis:/tmp/mysql-standard-4.1.16-pc-linux-gnu-i686-glibc23> ./bin/mysql -u root mysql < share/fill_help_tables.sql
lenz@metis:/tmp/mysql-standard-4.1.16-pc-linux-gnu-i686-glibc23> echo $?
0
[SNIP]

However, piping the SQL directly into mysqld (how mysql_install_db does it), does not seem to work anymore:

[SNIP]
lenz@metis:/tmp/mysql-standard-4.1.16-pc-linux-gnu-i686-glibc23> (echo 'use mysql;'; cat share/fill_help_tables.sql) | ./bin/mysqld --bootstrap --skip-grant-tables --skip-innodb --basedir=.
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 '' at line 1
060125 10:33:28 [ERROR] Aborting

060125 10:33:28 [Note] ./bin/mysqld: Shutdown complete
[SNIP]

This is a regression in mysqld - the same command worked just fine in 4.1.15.
Assigning it back to Kent, so he can put someone from the Maintenance Team on this case.
[25 Jan 2006 12:29] Lenz Grimmer
I just verified this with the 4.1.17 release that is currently in progress - the bug seems to have been resolved already. It may have been a side effect of another bug that was fixed in the meanwhile. Now, mysql_install_db does not complain anymore, piping the fill_help_tables SQL file into mysqld works again:

lenz@metis:/tmp/mysql-standard-4.1.17-pc-linux-gnu-i686-glibc23> (echo 'use mysql;'; cat share/fill_help_tables.sql) | ./bin/mysqld --bootstrap --skip-grant-tables --skip-innodb --basedir=.
lenz@metis:/tmp/mysql-standard-4.1.17-pc-linux-gnu-i686-glibc23> echo $?
0

I consider this bug resolved for the upcoming 4.1.17 release. Docs, please document it in the 4.1.17 NEWS section.
[26 Jan 2006 0:36] Mike Hillyer
Noted in 4.1.17 changelog.
[14 Apr 2010 9:46] B. Semt
hello, 
also i think the error is old, maybe solved, and my install was exotic i'd like to give notice to you that i ran into this same error with MySQL-5.5/MySQL-server-community-5.5.2_m2-1.sles10.x86_64.rpm, 
'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 '' at line 1' on a SLES10-SP1 machine, the funny thing is it didn't happen on the first install, but i had to de-install an re-install several times (rpm -i and rpm -e for all or part of the server, client, embedded, shared ... files, also had tries with 5.5.1 and 5.5.3 inbetween) to test something, and today noticed that from one point on - cannot say which, maybe second or fifteenth try - this error occurred, and now is 'stable', and occurs also with other versions (5.5.1, 5.5.3 ...), 
if this any help for you ... 
B.S.
[14 Apr 2010 12:24] B. Semt
hello, --- some flavour of bug 15965 solved ---

could solve it by myself, but may be interesting for you, 

'rpm -i MySQL-server-community-5.5.2_m2-1.sles10.x86_64.rpm', 

giving '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 '' at line 1 ...' 

what came for a script where mysql pipes data from an input file into the help tables, 

was forced by a 'sql-mode=NO_BACKSLASH_ESCAPES' statement in the server section of my 'my.cnf' file, in this case exactly '/root/.my.cnf' - check for 'dotted' resp. hidden files too when checking your system! -. 

from my 'outer point of view' i think the problem is caused by the parser analysing the whole statement including the part that's only data or 'objekt' to  the 'insert into xxx (...) values (yyy);' command - the part in the second brackets, here 'yyy', what's normally not his job, but may be neccessary to check where the end of the statement is, nice problem to work on for the developers. 

my need to use the 'sql-mode=...' configuration came from the installation of 'indimail', in the inst-doc is mentioned that without this statement the MySQL server will fail to parse the output of a configuration tool needed for this projekt, in respect to something named `mysql_real_escape_string()'. 

hope this helps, 

B.S.

P.S. if things like this are typical for sql ... bundle it with 'c' and throw away .... i want my good old pascal back (and 'magic' too!)