I followed this tutorial to install MySQL on Mac OS X 10.6.8. Now I get he following errors:
$ 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 directory
And
$ /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/
$ find /usr/local/mysql/ -name mysql.sock
find: /usr/local/mysql//data: Permission denied
$ sudo find /usr/local/mysql/ -name mysql.sock
Password:
$
Also, I can't login MySQL:
$ mysql -uroot
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
$ mysql -uroot -h127.0.0.1
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (61)
$ mysql -uroot -h127.0.0.1 --protocol=tcp
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (61)
And
$ /Library/StartupItems/MySQLCOM/MySQLCOM stop
Stopping MySQL database server
$ /Library/StartupItems/MySQLCOM/MySQLCOM start --skip-grant-tables
Starting MySQL database server
$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
$ sudo ls -l /usr/local/mysql/data/*.err
Password:
ls: /usr/local/mysql/data/*.err: No such file or directory
Re: @Matt Fenwick
$ sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
Stopping MySQL database server
$ sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
Starting MySQL database server
$ sudo mysqld -u root
120327 13:03:48 [Warning] Ignoring user change to 'root' because the user was set to 'mysql' earlier on the command line
120327 13:03:48 [Warning] Setting lower_case_table_names=2 because file system for /Volumes/storage/Data/ is case insensitive
$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
$ sudo mysqld -u mysql
120327 13:04:11 [Warning] Setting lower_case_table_names=2 because file system for /Volumes/storage/Data/ is case insensitive
$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
$
my.cnf used
[mysql]
max_allowed_packet=128M
socket=/tmp/mysql.sock
[mysqld]
user=mysql
datadir=/Volumes/storage/Data
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
#socket=/var/lib/mysql/mysql.sock
socket=/tmp/mysql.sock
innodb_log_file_size=256M
skip-locking
skip-bdb
delay-key-write=OFF
interactive_timeout=3600
wait_timeout=3600
thread_cache_size=128
table_cache=2048
skip-external-locking
max_connections=800
key_buffer_size=64M
read_buffer_size=1M
sort_buffer_size=2M
join_buffer_size=1M
read_rnd_buffer_size=2M
bulk_insert_buffer_size=10M
tmp_table_size=64M
max_heap_table_size=64M
max_connect_errors=5000
max_allowed_packet=128M
innodb_data_file_path=ibdata1:256M:autoextend
innodb_buffer_pool_size=1G
innodb_log_file_size=512M
innodb_flush_log_at_trx_commit=2
innodb_open_files=1000
/Library/StartupItems/MySQLCOM/MySQLCOM statusreturn? – Phil Mar 14 '12 at 16:05mdfind mysql.sockto locate mysql.sock, as it may be creating it in another directory – Phil Mar 14 '12 at 16:09MySQLCOM stopandMySQLCOM startare pasted in OP. – Problemania Mar 14 '12 at 16:16mdfind mysql.sockrevealed nothing relevant, AFAICT. – Problemania Mar 14 '12 at 16:21ps auxww | grep -i mysqld | grep -v grepreturn ? – Phil Mar 14 '12 at 16:26