Greetings Everyone,
I'm trying to install MySQL standard 4.1.22 on a Mac server running 10.4.7. I'm using the MySQLStartupItem.pkg to start MySQL. (I've tried similar installs with Mac server 10.4.8 and MySQL 5.0.27 with the same results). I'm not sure MySQL is running; see command line below. Further, when I try to connect to the server, I receive the error message 'Can't connect to server...'; see command line below. It appears that I cannot connect to MySQL because MySQL cannot locate a file titled mysql.sock; again see below. When I do a find in /var/ per the error message, the file is not located in /var/; see below. However, when I do a find in /, I locate the file at ./private/tmp/mysql.sock. From what I have read, I believe this has something to do with a file titled my.cnf. However, when I do a find for my.cnf at /, the file does not appear to anywhere; please see below. Any assistance is greatly appreciated.
TIA,
George
Last login: Thu Feb 1 09:47:06 on console
Welcome to Darwin!
moodle:~ root# cd /
moodle:/ root# ps xa | grep mysqld
198 ?? S 0:00.01 /bin/sh ./bin/mysqld_safe --datadir=/usr/local/mysql/
217 ?? S 0:00.08 /usr/local/mysql/bin/mysqld --defaults-extra-file=/us
304 p1 S+ 0:00.00 grep mysqld
moodle:/ root# mysqladmin version
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/mysql/mysql.sock' exists!
moodle:/ root# cd /var/
moodle:/var root# ls
amavis db mail run tmp
at empty mailman rwho virusmails
audit imap msgs samba vm
backups jabber named servermgrd xgrid
clamav launchd netboot spool yp
cron log root swupd
moodle:/var root# find . -name mysql.sock -print
moodle:/var root# find . -name mysql.sock -print
moodle:/var root# cd /
moodle:/ root# find . -name mysql.sock -print
./private/tmp/mysql.sock
moodle:/ root# find . -name my.cnf -print
moodle:/ root#
In reply to George Frazier
Re: Mac Server, MySQL, and 'Can't connect to local....'
by Howard Miller -
Mmm.... have you had a look at...
http://dev.mysql.com/doc/refman/5.0/en/can-not-connect-to-server.html
http://dev.mysql.com/doc/refman/5.0/en/can-not-connect-to-server.html
In reply to Howard Miller
Re: Mac Server, MySQL, and 'Can't connect to local....'
by George Frazier -
Thanks for the tip. I have read this article several times. I'm not sure what I am doing wrong, but MySQL is not creating the my.cnf file when it starts automatically using the System Preference Pane.
This is a handy page of OSX MySQL tips, including...
http://www.comentum.com/mysql-administration.html
When running MySQL and PHP on the same Mac OS X 10.4 server, you may find that PHP cannot connect to MySQL. When PHP is communicating with a MySQL server on the same host, it uses a socket file to communicate, and looks for it at /tmp/mysql.sock. On Mac OS X Server 10.4, MySQL creates this socket file at /var/mysql/mysql.sock.
To resolve this issue, you can either change the location where MySQL creates its socket file, or modify the location where PHP looks for the file. Please note that the first option is less secure than the second.
To resolve this issue, you can either change the location where MySQL creates its socket file, or modify the location where PHP looks for the file. Please note that the first option is less secure than the second.
http://www.comentum.com/mysql-administration.html
Peter,
Thank you for the direction. MySQL was no longer starting until I made the recommended change (number 2) provided in the site you suggested. However, the install.php keeps stalling at the fourth screen that refers to connecting to the database. I keep getting the error message: "We could not connect to the database you specified. Please check your database settings." I confirmed MySQL is running. Confirmed moodleuser can log into MySQL via mysql -u moodleuser -p moodle. I feel like I'm still missing something between PHP and MySQL. I'm conducting this install on a Mac Server running OS 10.4.8. Any recommendations are greatly appreciated.
Thanks,
George
Thank you for the direction. MySQL was no longer starting until I made the recommended change (number 2) provided in the site you suggested. However, the install.php keeps stalling at the fourth screen that refers to connecting to the database. I keep getting the error message: "We could not connect to the database you specified. Please check your database settings." I confirmed MySQL is running. Confirmed moodleuser can log into MySQL via mysql -u moodleuser -p moodle. I feel like I'm still missing something between PHP and MySQL. I'm conducting this install on a Mac Server running OS 10.4.8. Any recommendations are greatly appreciated.
Thanks,
George