I had MySQL running fine on my Mac till earlier today when I installed homebrew and also updated my Path.
When I try to run mysql from my ternimal window now, I get the following error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
I can't connect MySQLAdmin either.
I can't even run Mysqld. The error I get when trying to run mysqld is that it can't create test file.
I also tried to telnet localhost 3306 and wasn't able to connect.
Any help would be appreciated as I am fairly new to Mac.
If it's homebrew installation try:
$ mysql.server start
Basically, all you have to do is:
You will now be able to start the MySQL command prompt without getting the "Can't connect..." error.
The mysql error (2002) is caused by the fact mysqld isn't running. The error you are seeing when starting mysqld is probably a permissions issue. Try starting mysqld as root or sudo'ing the command.
I'm user of osX 10.11.3 (El Capitan)
first of all, check your mysql version.
$ mysql --version
check the server is already running.
$ ps -ex | grep mysql
If you checked this following string, that means mysql server is already running.
=> mysqld_safe / --pid-file=#{path}
(The mysql pid file created when mysql server running to succeessfully. )
In that case, you have to stop mysql server.
$ mysql.server stop
and start your mysql server
$ mysql.server start
Starting MySQL SUCCEESS!
and start(or restart) your mysql server
$ mysql.server start
$ mysql.server restart
If you failed to start mysql server, please leave me error message when you run mysql.server start
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With