Bug #10834 4.1.11-standard 64 bit on Solaris 9 puts mysql and test db in wrong directory
Submitted: 24 May 2005 17:17 Modified: 5 Aug 2005 9:27
Reporter: Scott Koranda Email Updates:
Status: Can't repeat Impact on me:
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:4.1.11-standard Solaris 9 64 bit OS:Solaris (Solaris 9 64 bit)
Assigned to: CPU Architecture:Any

[24 May 2005 17:17] Scott Koranda
Even though 
./scripts/mysql_install_db --defaults-file=./my.cnf

was run and the file ./my.cnf contains the line

datadir = /export/grid/LDR/mysqldata1

the 'mysql' and 'test' databases were written into the directory 
<installation_dir>/data/. In order to start the server I had to
manually copy the files/directories to /export/grid/LDR/mysqldata1.

I did NOT find this problem when installting 4.1.11 on Linux, so I think it is
Solaris specific.

How to repeat:
Untar and unzip the file mysql-standard-4.1.11-sun-solaris2.9-sparc-64bit.tar.gz. Make
some directory else that is to be the 'data' directory, such as /opt/mysqldata. Edit
a my.cnf file and define 'datadir' to point to the data directory (/opt/mysldata).

Change directories into the mysql-standard-4.1.11-sun-solaris2.9-sparc-64bit directory and run './scripts/mysql_install_db --defaults-file=./my.cnf'. Then try to start the server by doing
'./bin/mysqld --defaults-file=./my.cnf'. You should see this:

 [ERROR] Fatal error: Can't open privilege tables: Table 'mysql.host' doesn't exist

Copy the directories 'mysql' and 'test' and their contents from 
mysql-standard-4.1.11-sun-solaris2.9-sparc-64bit/data/ to /opt/mysqldata/ and then
again run './bin/mysqld --defaults-file=./my.cnf'. This time the server should start.
[5 Aug 2005 9:27] Valeriy Kravchuk
Thank you for your bug report. I tried to repeat it with the latest 4.1.13 version on our server:

bash-2.05$ uname -a
SunOS sunfire280 5.9 Generic_118558-09 sun4u sparc SUNW,Sun-Fire-280R

I installed it into the following directory (using make install):

bash-2.05$ pwd

Then I created a local my.cnf file such that:

bash-2.05$ grep -n datadir my.cnf

Note that is NOT stadard data subdirectory. Then I called:

bash-2.05$ bin/mysql_install_db --defaults-file=./my.cnf
Installing all prepared tables
Fill help tables

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

And got all the tables in the ~/data directory, as stated in ./my.cnf:

bash-2.05$ ls -F ~/data
ib_logfile0             mysql/                  sunfire280-bin.000003
ib_logfile1             sunfire280-bin.000001   sunfire280-bin.index
ibdata1                 sunfire280-bin.000002   test/

Server started without any problems:

bash-2.05$ bin/mysqld_safe --defaults-file=./my.cnf &
Starting mysqld daemon with databases from /users/vkravchuk/data

And it works:

bash-2.05$ bin/mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.1.13

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select version();
| version() |
| 4.1.13    |
1 row in set (0.00 sec)

mysql> use test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

So, please, try to install 4.1.13 according to the documentation (http://dev.mysql.com/doc/mysql/en/quick-install.html or http://dev.mysql.com/doc/mysql/en/installing-binary.html). May be, you just had no needed permissions on your data directory.
[5 Aug 2005 13:24] Scott Koranda
No, it is broken in 4.1.11. We have since upgraded to 4.1.13 and found that it does indeed work--but 4.1.11 was broken.