MySQL Hangs on StartUp - Transition from MacPorts - Solved

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

MySQL Hangs on StartUp - Transition from MacPorts - Solved

Postby mbs402 » 28. June 2009 22:17

I had been using MacPorts MAMP for some time but several days ago I tried to install it on a brand new machine, and ran into some problems with mySQL, so while I was waiting for it to be fixed I decided to try XAMPP. The control panel allowed me to startup Apache, but MySQL kept hanging up showing "Starting" and would go no further.

I searched the XAMPP discussions board after translating into English using http://babelfish.yahoo.com/. Once I could understand the content of the Topics I did a search on "+mac +mysql +start" and also tried "+mysql +start +hang" but didn't find much that directly addressed my problem. I did however find a reference to "/Applications/XAMPP/xamppfiles/xampp start" which was great. After restarting the iMacG5 I pulled up the Terminal and tried the following :

[2009.28.06](10:42AM) -> [roscoe] ~ $ sudo echo
Password: <sudo_password>

[2009.28.06](10:44AM) -> [roscoe] ~ $ sudo /Applications/XAMPP/xamppfiles/xampp start
Starting XAMPP for MacOS X 1.0.1...
XAMPP: Starting Apache...
XAMPP: Starting MySQL...
XAMPP: Starting ProFTPD...
XAMPP for MacOS X started.

[2009.28.06](10:44AM) -> [roscoe] ~ $ sudo /Applications/XAMPP/xamppfiles/bin/mysql.server: line 292: cd: /opt/local/lib/mysql5: No such file or directory
---> Finally a clue to the problem. I had deleted the MacPorts "/opt/local/" directory, but there were still references to it...

---> ( 1 ) First to remove the references from the $PATH

[2009.28.06](10:47AM) -> [roscoe] ~ $ sudo open -a /Applications/BBEdit.app ~/.bashrc
[2009.28.06](10:48AM) -> [roscoe] ~ $ sudo open -a /Applications/BBEdit.app ~/.bash_profile

Searched .bashrc and .bash_profile for "/opt/local" and sure enough found a couple of instances where MacPorts had added:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export MANPATH=/opt/local/share/man:$MANPATH

so I commented them out.

# export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# export MANPATH=/opt/local/share/man:$MANPATH

---> ( 2 ) Just for grins let me try to launch again...

[2009.28.06](10:48AM) -> [roscoe] ~ $ sudo /Applications/XAMPP/xamppfiles/xampp start
Starting XAMPP for MacOS X 1.0.1...
XAMPP: Starting Apache...
XAMPP: Starting MySQL...
XAMPP: Starting ProFTPD...
/Applications/XAMPP/xamppfiles/bin/mysql.server: line 292: cd: /opt/local/lib/mysql5: No such file or directory
XAMPP for MacOS X started.

---> ( 3 ) There is still a reference most likely in the previous "/private/etc/my.cnf" which is where I kept the Apple "my.cnf". Normally MacPorts looks for "my.cnf" in /opt/local/etc but that is not where I keep it...

[2009.28.06](10:52AM) -> [roscoe] ~ $ sudo open /etc

And sure enough, there was "/private/etc/my.cnf"

[2009.28.06](10:54AM) -> [roscoe] ~ $ sudo open -a /Applications/BBEdit.app /private/etc/my.cnf


Traced the problems to /private/etc/my.cnf
<snip>
port = 3306
user = mysql
# ----------------------------------------------------------------------
# FOR THE STANDARD INSTALL AT : /usr/local/mysql
# ----------------------------------------------------------------------
# socket = /tmp/mysql.sock
# basedir = /usr/local/mysql
# datadir = /usr/local/mysql/data
# ----------------------------------------------------------------------
# FOR THE MACPORTS INSTALL AT : /opt/local/lib/mysql
# ----------------------------------------------------------------------
socket = /opt/local/var/run/mysql5/mysqld.sock
basedir = /opt/local/lib/mysql5
datadir = /opt/local/var/db/mysql5
# ----------------------------------------------------------------------
</snip>

So the easiest solution for now, is to rename the file, rather than compare it with the "/Applications/XAMPP/etc/my.cnf". For right now all I want to do is get XAMPP running, later I can compare the two "my.cnf" files...

---> ( 4 ) [2009.28.06](10:54AM) -> [roscoe] ~ $ sudo mv /private/etc/my.cnf /private/etc/my_disabled_my.cnf

Restart the machine, and try to startup MySQL again...

---> ( 5 ) [2009.28.06](11:03AM) -> [roscoe] ~ $ sudo /Applications/XAMPP/xamppfiles/xampp start
Starting XAMPP for MacOS X 1.0.1...
XAMPP: File permissions are being checked... this may take a while.
XAMPP: Starting Apache...
XAMPP: Starting MySQL...
XAMPP: Starting ProFTPD...
XAMPP for MacOS X started.

[2009.28.06](11:04AM) -> [roscoe] ~ $ sudo ps aux | grep mysql
nobody 515 0.0 0.3 103084 13496 s000 S 11:04AM 0:00.12 /Applications/XAMPP/xamppfiles/sbin/mysqld
--basedir=/Applications/XAMPP/xamppfiles
--datadir=/Applications/XAMPP/xamppfiles/var/mysql
--user=nobody
--log-error=/Applications/XAMPP/xamppfiles/var/mysql/roscoe.local.err
--pid-file=/Applications/XAMPP/xamppfiles/var/mysql/roscoe.local.pid
--socket=/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock
--port=3306
root 417 0.0 0.0 75884 708 s000 S 11:04AM 0:00.02 /bin/sh /Applications/XAMPP/xamppfiles/bin/mysqld_safe
--datadir=/Applications/XAMPP/xamppfiles/var/mysql
--pid-file=/Applications/XAMPP/xamppfiles/var/mysql/roscoe.local.pid
root 523 0.0 0.0 75452 376 s000 S+ 11:04AM 0:00.00 grep mysql

[2009.28.06](11:04AM) -> [roscoe] ~ $

Looks like MySQL is up and running...
Next step was to import all the data from the last backup. Everything imported, and this was pretty painless...

GREAT JOB to the XAMPP Team...
mbs402
 
Posts: 2
Joined: 28. June 2009 16:04

Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 4 guests