Bug #31058 Solaris PKG install puts data files in wrong location
Submitted: 17 Sep 2007 12:21 Modified: 23 Sep 2010 22:01
Reporter: MC Brown Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:5.0.58, 5.1.22 OS:Solaris (i686, 32-bit)
Assigned to: Jonathan Perkin CPU Architecture:Any

[17 Sep 2007 12:21] MC Brown
Description:
Running the 32-bit PKG installation of Solaris, the data files created during installation are installed in the wrong place

The mysqld/mysqld_safe default data directory is /usr/local/mysql/data (or /opt/mysql/mysql/data). 

When scripts/mysql_install_db is run during the package installation, the data files are actually created in /var/lib/mysql. 

How to repeat:
Install 32-bit Solaris Package

Try starting mysqld or mysqld_safe after the initial installation, the startup will fail and a dump of the .errs file shows the problem as missing table/database files: 

./bin/mysqld --user=mysql
./bin/mysqld: Table 'mysql.plugin' doesn't exist
070917 12:47:51 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
070917 12:47:51  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
070917 12:47:51  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
070917 12:47:52  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
070917 12:47:52  InnoDB: Started; log sequence number 0 0
070917 12:47:52 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

The innodb log files are placed into /usr/local/mysql/data, so this is where mysqld expects to find the rest of the table files by default. Copying the contents of /var/lib/mysql/* to /usr/local/mysql/data/* and restarting mysqld resolves the problem, so the files are being created correctly, just in the wrong place. 

Suggested fix:
Identification of the installation location during PKG builds is wrong and the files are being installed in the wrong place. This may relate to the directory installation issues that are also part of Bug #31057.
[25 Sep 2007 12:26] Sveta Smirnova
Thank you for the report.

Verified analyzing *.pkg file.
[17 Oct 2007 18:02] M Weiss
Verified. In order to start mysqld - you need to pass it the correct datadir. Something like: mysqld_safe --user=mysql --datadir=/var/lib/mysql/

(in case someone is searching for whey they get: Table 'mysql.host' doesn't exist on Solaris)
[20 Mar 2008 14:03] Alexey Kopytov
Ran into this bug when smoketesting mysql-enterprise-gpl-5.0.58-solaris10-i386.pkg
[17 Apr 2008 9:38] Uwe Schrader
I encountered the same issue on Solaris 10 SPARC 64bit using mysql-5.0.51a-solaris10-sparc-64bit.pkg.
[11 Aug 2010 12:00] Jonathan Perkin
Three years, sorry :(

I've changed the internal build scripts and this should be in place for 5.1.51.  I will leave the bug open until I can verify those packages.

5.5/5.6 releases should already have it fixed as those are built differently.
[23 Sep 2010 11:53] Jonathan Perkin
I verified this is fixed with 5.1.51, sending for documentation and closing.
[23 Sep 2010 22:01] Paul Dubois
Noted in 5.1.51 changelog.

A PKG install on Solaris put some files in incorrect locations.