Bug #65584 mysql_install_db.pl creates empty system tables for MySQL 5.5.25 (Enterprise )
Submitted: 11 Jun 2012 14:40 Modified: 13 Nov 2012 18:28
Reporter: DBA Lead Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:5.5.25 OS:Windows (tested on Windows XP and Mac OSX)
Assigned to: CPU Architecture:Any
Tags: mysql_install_db.pl, system tables, windows

[11 Jun 2012 14:40] DBA Lead
Description:
mysql_install_db.pl creates empty system tables for "Patch 14136986: MySQL Database 5.5.25 ZIP for Windows x86 (64bit)" MySQL server. I tried on Windows XP and Mac OSX. The error messages are not shown on command line in Windows but are logged in the error log. Here is the output of running the command in Windows XP:

perl -w mysql_install_db.pl --basedir="C:\Program Files\MySQL\MySQL Server 5.5" --datadir="c:\MYSQL\DESERVER1\data" --force --verbose

Installing MySQL system tables...OK

Filling help tables...OK

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

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

 C:\Program Files\MySQL\MySQL Server 5.5/bin/mysqladmin -u root password 'new-password'
 C:\Program Files\MySQL\MySQL Server 5.5/bin/mysqladmin -u root -h WIN08R2MYSQLENT password 'new-password'

Alternatively you can run:

 C:\Program Files\MySQL\MySQL Server 5.5/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

 cd C:/Program Files (x86)/MySql/MySQL Server 5.1 ; C:\Program Files\MySQL\MySQL Server 5.5/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

 cd mysql-test ; perl mysql-test-run.pl

Please report any problems with the C:/Program Files (x86)/MySql/MySQL Server 5.1/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 http://shop.mysql.com 

The error message that I first got was:
120611 10:28:14 [ERROR] /usr/local/mysql/bin/mysqld: unknown option '--skip-bdb'
120611 10:28:14 [ERROR] Aborting

Then it complains about other skip options in the script. I made it work by removing the following three lines from the script:

"--skip-innodb",
"--skip-bdb",
"--skip-ndbcluster",

That seems to have fixed the issue but I got the following errors at the end of error log (MySQL system tables and innodb data and log files were created though):

120608 17:10:45 InnoDB: 1.1.8 started; log sequence number 1595675
ERROR: 1406  Data too long for column 'url' at row 1
120608 17:10:45 [ERROR] Aborting

120608 17:10:45  InnoDB: Starting shutdown...
120608 17:10:46  InnoDB: Shutdown completed; log sequence number 1595675
120608 17:10:46 [Note] C:\Program Files\MySQL\MySQL Server 5.5/bin/mysqld.exe: Shutdown complete 

The url column exists in one of the help tables help_topic. It looks like the schema creation script did not create the table with right column size. I had to modify the help table creation script that exists in basedir/share/mysql_system_tables.sql file and used TEXT column instead of char(128) in help_topic table and ran the mysql_install_db.pl script again with success.

Is it appropriate to use this method (updating the sql script) as a workaround for customers building production environments until the next release? Please let me know.

Thanks.

How to repeat:
First issue:

- Download and extract MySQL Database 5.5.25 ZIP for Windows x86 (64bit)
- Use mysql_install_db.pl script in scripts/ folder to create system database in any writable directory
perl mysql_install_db.pl --basedir="C:\Program Files\MySQL\MySQL Server 5.5" --datadir="c:\MYSQL\DESERVER1\data" --force --verbose
- Look for errors in error log

Second issue:

- After fixing the above issue by removing the following lines:
"--skip-innodb",
"--skip-bdb",
"--skip-ndbcluster",
The script runs successfully but with following errors:
120608 17:10:45 InnoDB: 1.1.8 started; log sequence number 1595675
ERROR: 1406  Data too long for column 'url' at row 1
120608 17:10:45 [ERROR] Aborting

120608 17:10:45  InnoDB: Starting shutdown...
120608 17:10:46  InnoDB: Shutdown completed; log sequence number 1595675
120608 17:10:46 [Note] C:\Program Files\MySQL\MySQL Server 5.5/bin/mysqld.exe: Shutdown complete 

See description for how I fixed this issue.

Suggested fix:
Removing the following lines from the script:
"--skip-innodb",
"--skip-bdb",
"--skip-ndbcluster",

and modifying help tables schema.
[11 Jun 2012 18:31] Sveta Smirnova
Thank you for the report.

mysql_install_db is not supposed to be used on Winodws. Use database provided wit Windows package.

Although our user manual does not say about it here: http://dev.mysql.com/doc/refman/5.5/en/mysql-install-db.html So verified as documentation bug.
[29 Jun 2012 21:01] Paul DuBois
If it's not supposed to be used on Windows, why is it included in Windows distributions? (You can see from the example commands that it was invoked as a command included in one of our distributions.)

This is not a docs bug, at least not yet. Developers, please decide whether the script should be included in Windows distributions. If not, it's a bug that it is included. If it should be included, please fix the bug described in this report.
[13 Nov 2012 18:28] Paul DuBois
Noted in 5.1.67, 5.5.29, 5.6.8, 5.7.0 changelogs.

On Windows, the Perl version of mysql_install_db created system
tables in the mysql database that were not populated properly.