Starting MySQL server on Mac OSX 10.2 Server

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Paul Oertel
Forum Newbie
Posts: 18
Joined: Fri May 31, 2002 3:44 am
Location: Japan

Starting MySQL server on Mac OSX 10.2 Server

Post by Paul Oertel »

I installed Mac OSX 10.2 server. I found the MySQL executables but I am having trouble starting mysqld server.

I first tried to run the server directly from /usr/libexec/mysqld. I got the following errors. When I tried the mysql.server shell script I got errors telling me there was no macppc03.pid

Code: Select all

їmacppc03:/] pbearpro% /usr/libexec/mysqld
020910 23:08:53  /usr/libexec/mysqld: Can't create/write to file '/var/macppc03.pid' (Errcode: 13)
020910 23:08:53  /usr/libexec/mysqld: Table 'mysql.host' doesn't exist
020910 23:08:53  /usr/libexec/mysqld: Error on delete of '/var/macppc03.pid' (Errcode: 2)
So I used the touch command to create a pid file and then I tried to run the app MySQL server again.

Code: Select all

їmacppc03:/] pbearpro% sudo touch macppc03.pid
їmacppc03:/] pbearpro% sudo /usr/libexec/mysqld
Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
020910 23:09:54  Aborting

020910 23:09:54  /usr/libexec/mysqld: Shutdown Complete
It complained about running as root. I realized that this was not a good idea so I tried the mysql.server shell script.

Code: Select all

їmacppc03:/usr/share/mysql] pbearpro# ./mysql.server start
їmacppc03:/usr/share/mysql] pbearpro# touch: /var/mysql/macppc03.err: No such file or directory
chown: /var/mysql/macppc03.err: No such file or directory
Starting mysqld daemon with databases from /var/mysql
/usr/bin/safe_mysqld: /var/mysql/macppc03.err: No such file or directory
/usr/bin/safe_mysqld: /var/mysql/macppc03.err: No such file or directory
tee: /var/mysql/macppc03.err: No such file or directory
020911 00:08:25  mysqld ended
tee: /var/mysql/macppc03.err: No such file or directory
The server complained about no their being no .err file so I used touch to and mkdir to create the required path.

Code: Select all

їmacppc03:/usr/share/mysql] pbearpro# mkdir /var/mysql
їmacppc03:/usr/share/mysql] pbearpro# touch /var/mysql/macppc03.err
їmacppc03:/usr/share/mysql] pbearpro# ./mysql.server start
їmacppc03:/usr/share/mysql] pbearpro# Starting mysqld daemon with databases from /var/mysql
020911 00:09:32  mysqld ended
The server still refused to start up but this time I at least got an error file. The error file showed the following.

Code: Select all

їmacppc03:/usr/share/mysql] pbearpro# more /var/mysql/macppc03.err
020911 00:09:32  mysqld started
020911  0:09:32  /usr/libexec/mysqld: Can't create/write to file '/var/mysql/macppc03.pid' (Errcode: 13)
020911  0:09:32  /usr/libexec/mysqld: Table 'mysql.host' doesn't exist
020911  0:09:32  /usr/libexec/mysqld: Error on delete of '/var/mysql/macppc03.pid' (Errcode: 2)
020911 00:09:32  mysqld ended
I though that, maybe, since I created the /var/mysql directory and .err file with root that the mysql account under which the server was trying to run might be having trouble writing to the file so I changed the resource owner to mysql and tried to run the server again.

Code: Select all

їmacppc03:/usr/share/mysql] pbearpro# chown mysql /var/mysql
їmacppc03:/usr/share/mysql] pbearpro# ./mysql.server start
їmacppc03:/usr/share/mysql] pbearpro# Starting mysqld daemon with databases from /var/mysql
020911 00:16:03  mysqld ended

20911 00:16:03  mysqld started
020911  0:16:03  /usr/libexec/mysqld: Table 'mysql.host' doesn't exist
020911 00:16:03  mysqld ended
As you can see, some of the errors disappeared but some still remain. It seems to me that the default mysql table with all the grant information and other necessary information doesn't exist. Do I need to create these files myself or do they already exist and I have been just barking up the wrong tree?

Any help you could give me is greatly appreciated.

Regards,
Paul
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

This might help you: http://www.phpmac.com/articles/view.php?art=59.dat

And you will notice, PHPMac.com is a PHPDN member as well. :D
Post Reply