snippetsqlMinor
How to initiate MySQL on Mac OS X 10.6.8?
Viewed 0 times
initiatemysqlmachow
Problem
I followed this tutorial to install MySQL on Mac OS X 10.6.8. Now I get he following errors:
And
And
```
$ mysqladmin ping
/usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
$ mysqladmin -uroot ping
/usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
$ mysqladmin -uroot -h127.0.0.1 ping
/usr/local/mysql/bin/mysqladmin: connect to server at '127.0.0.1' failed
error: 'Lost connection to MySQL server at 'reading initial communication packet', system error: 61'
$ mysqladmin -uroot -h127.0.0.1 --protocol=tcp ping
/usr/local/mysql/bin/mysqladmin: connect to server at '127.0.0.1' failed
error: 'Lost connection to MySQL server at 'reading initial communication packet', system error: 61'
$ ls /usr/local/mysql
mysql/ mysql-5.0.95-osx10.5-x86_64/
$ ls /usr/local/mysql/
COPYING README configure docs/ lib/ mysql-test/ share/ support-files/
INSTALL-BINARY bin/ data/ include/ man/ scripts/ sql-bench/ tests/
$ mysqladmin version
/usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
$ ls /tmp/mysql.sock
ls: /tmp/mysql.sock: No such file or directoryAnd
$ /Library/StartupItems/MySQLCOM/MySQLCOM stop
Stopping MySQL database server
$ /Library/StartupItems/MySQLCOM/MySQLCOM start
Starting MySQL database server
$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)And
```
$ mysqladmin ping
/usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
$ mysqladmin -uroot ping
/usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
$ mysqladmin -uroot -h127.0.0.1 ping
/usr/local/mysql/bin/mysqladmin: connect to server at '127.0.0.1' failed
error: 'Lost connection to MySQL server at 'reading initial communication packet', system error: 61'
$ mysqladmin -uroot -h127.0.0.1 --protocol=tcp ping
/usr/local/mysql/bin/mysqladmin: connect to server at '127.0.0.1' failed
error: 'Lost connection to MySQL server at 'reading initial communication packet', system error: 61'
$ ls /usr/local/mysql
mysql/ mysql-5.0.95-osx10.5-x86_64/
$ ls /usr/local/mysql/
COPYING README configure docs/ lib/ mysql-test/ share/ support-files/
INSTALL-BINARY bin/ data/ include/ man/ scripts/ sql-bench/ tests/
Solution
I had this exact same problem (although I'm on Mac OS X 10.5.8) with all the same error messages.
It turned out the problem was that when the computer was turned on, MySQL was not started automatically.
I solved it by manually starting MySQL:
Note the
After running that command, everything works fine for me.
It turned out the problem was that when the computer was turned on, MySQL was not started automatically.
I solved it by manually starting MySQL:
prompt$ sudo mysqld -u root Note the
sudo: MySQL wouldn't let me start up the server without root access to both the computer and MySQL itself (not that I'm complaining, but it was just frustrating until I figured that out). Also note that the program is mysqld, not mysql.After running that command, everything works fine for me.
Code Snippets
prompt$ sudo mysqld -u root <secure password goes here!>Context
StackExchange Database Administrators Q#15004, answer score: 2
Revisions (0)
No revisions yet.