Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Got error: 2002: Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2) when trying to connect 150629 15:44:35 mysqld_safe Starting mysqld daemon with databases from /Applications/MAMP/db/mysql 150629 15:44:35 [Warning] You have forced lower_case_table_names to 0 through a command-line option, even though your file system '/Applications/MAMP/db/mysql/' is case insensitive. This means that you can corrupt a MyISAM table by accessing it with different cases. You should consider changing lower_case_table_names to 1 or 2 150629 15:44:35 [Note] Plugin 'FEDERATED' is disabled. 150629 15:44:35 [Note] Plugin 'ndbcluster' is disabled. /Applications/MAMP/Library/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13) 150629 15:44:35 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 150629 15:44:35 InnoDB: Started; log sequence number 1 402900962 150629 15:44:35 [ERROR] /Applications/MAMP/Library/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13) 150629 15:44:35 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13) 150629 15:44:35 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended

I can't find mysql.sock file anywhere. This is MAMP 1.9 on OS X version 10.8.5

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
234 views
Welcome To Ask or Share your Answers For Others

1 Answer

The first thing to try is to change the ownership of the datadir of MySQL, for example, if you run MySQL with user mysql:

chown -R mysql:mysql /path/to/datadir

check the privilges of /Applications/MAMP/tmp/mysql/ directory for creating socket.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...