MySQL fails to start

Hi,

I've been trying to get MySQL to work on Snow Leopard server all day, but i simply can't get it to start up. I hope someone here can help 🙂

Here is the problem.

I have a new Mac Mini running Snow Leopard Server. It is currently running only DNS, Web services, and Open directory.

The web service is set up with PHP active, which works fine.

I now want to activate MySQL.

I go to the server admin and add the MySQL service there. I AM using the standard Snow Leopard Server MySQL service, i have NOT installed MySQL myself from the MySQL site.

I set the database location to be an external drive connected to the server.

I then start the service.

The service LOOKS like it is started, it shows up as green etc. However the Start/Stop button does not change to "Stop" it stays at "Start MySQL". The MySQL log keeps running, and because of the errors it is "spamming" my harddrive with log entries - and i can't turn off MySQL.

The MySQL service log only contains the following entries:

+091016 20:07:03 [Warning] Setting lower case_tablenames=2 because file system for /Volumes/Mac server external/mysql/databases/ is case insensitive+
+InnoDB: The InnoDB memory heap has been disabled.+
+InnoDB: Mutex and rw_lock use GCC atomic builtins.+
+InnoDB: Log scan progressed past the checkpoint lsn 0 36808+
+091016 20:07:03 InnoDB: Database was not shut down normally!+
+InnoDB: Starting crash recovery.+
+InnoDB: Reading tablespace information from the .ibd files...+
+InnoDB: Restoring possible half-written data pages from the doublewrite+
+InnoDB: buffer...+
+InnoDB: Doing recovery: scanned up to log sequence number 0 43655+
+091016 20:07:03 InnoDB: Starting an apply batch of log records to the database...+
+InnoDB: Progress in percents: 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99+
+InnoDB: Apply batch completed+
+091016 20:07:03 InnoDB: Started; log sequence number 0 43655+
+091016 20:07:03 [Note] Recovering after a crash using mysql-bin+
+091016 20:07:03 [Note] Starting crash recovery...+
+091016 20:07:03 [Note] Crash recovery finished.+
+091016 20:07:03 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist+

The MySQL admin log contains the following:

+2009-10-16 19:52:08 Europe/Copenhagen Initialization warning/error results:+
+/usr/libexec/mysqld: Too many arguments (first extra is 'server').+
+Use --help to get a list of available options+
+cat: stdout: Broken pipe+
+2009-10-16 19:52:08 Europe/Copenhagen [W] Execution of mysqlinstalldb failed; error = Operation not permitted (1).+
+2009-10-16 19:52:08 Europe/Copenhagen [E] Database creation failed.+
+2009-10-16 19:52:08 Europe/Copenhagen
Initializing database directory: /Volumes/Mac server external/mysql/databases+
+2009-10-16 19:52:08 Europe/Copenhagen Initialization results:+
+Installing MySQL system tables...+
+Installation of system tables failed!+
+Examine the logs in /Volumes/Mac server external/mysql/databases for more information.+
+You can try to start the mysqld daemon with:+
+/usr/libexec/mysqld --skip-grant &+
+and use the command line tool+
+/usr/bin/mysql to connect to the mysql+
+database and look at the grant tables:+
+shell> /usr/bin/mysql -u root mysql+
+mysql> show tables+
+Try 'mysqld --help' if you have problems with paths. Using --log+
+gives you a log in /Volumes/Mac server external/mysql/databases that may be helpful.+
+The latest information about MySQL is available on the web at+
+
http://www.mysql.com+
+Please consult the MySQL manual section: 'Problems running mysql installdb',+
+and the manual section that describes problems on your OS.+
+Another information source is the MySQL email archive.+
+Please check all of the above before mailing us!+
+And if you do mail us, you MUST use the /usr/bin/mysqlbug script!+
+2009-10-16 19:52:08 Europe/Copenhagen Initialization warning/error results:+
+/usr/libexec/mysqld: Too many arguments (first extra is 'server').+
+Use --help to get a list of available options+
+2009-10-16 19:52:08 Europe/Copenhagen [W] Execution of mysqlinstalldb failed; error = Operation not permitted (1).+
+2009-10-16 19:52:08 Europe/Copenhagen [E] Database creation failed.+
+2009-10-16 19:52:08 Europe/Copenhagen
Resetting root password...+
+2009-10-16 19:52:38 Europe/Copenhagen [E] MySQL: timed out waiting to launch mysql without grant tables.+
+2009-10-16 19:52:38 Europe/Copenhagen [E] MySQL: mysql shutdown timed out.+
+2009-10-16 19:52:38 Europe/Copenhagen Reset root password reported errors.+
Can anyone give me some advice on what to do? I'm not much of a Mac OS X genius so all help is appreciated 🙂
Message was edited by: Razu

Intel Mac Mini, Mac OS X (10.6)

Posted on Oct 16, 2009 11:10 AM

Reply
5 replies

Oct 17, 2009 3:57 AM in response to jaydisc

Hi,

This is what i get from the terminal.

+bash-3.2# ls -al /external/mysql/databases+
+total 319616+
drwx------ 5 _mysql admin 170 Oct 16 09:06 .+
drwxr-xr-x 3 root admin 102 Oct 16 09:06 ..+
drwx------ 2 _mysql admin 68 Oct 16 09:06 mysql+
drwx------ 2 _mysql admin 68 Oct 16 09:06 test+
-rw-rw---- 1 _mysql admin 163641864 Oct 17 12:43 zendo.dk.err+
bash-3.2#

It is also the folder where the failing mysql service is generating all the log files.

Thanks for the help 🙂

Oct 18, 2009 8:32 AM in response to Razu

There is evidence in the log that you have specified the data folder as "/Volumes/Mac server external/mysq/databases". But the database was actually created on the boot volume as /external/mysql/databases, not on the mounted volume as you intended. This is because spaces are not allowed in the data folder path, even if escaped or quoted. To clean up the mess, you can either change the MySQL data folder path to the default location on the boot volume, or you can rename your external volume to something like /Volumes/MacServerExternal/.. and try again.

Oct 18, 2009 9:04 AM in response to A 

The install was made from a clean install, so there wherent any existing db that was interfering.

I just did a clean install of the entire server, started MySQL with the default location on the harddrive, and it works.

I THINK that the problem was that i might have been too quick when i booted up MySQL for the first time. I selected the external drive (which had a space in its name...which is not allowed) started the service, and then immediately asked it to change the root password....and then it broke.

What really troubled me was that it became impossible to shutdown the service.

But its working now (via a server re-install). Thanks for all the help!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

MySQL fails to start

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.