Error #2002 Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)

前端 未结 6 1267
Happy的楠姐
Happy的楠姐 2020-12-01 16:48

I\'m running MAMP.
It has been working fine up until yesterday. I haven\'t been able to find anything that helps so far. But here is my problem:

As the title

6条回答
  •  Happy的楠姐
    2020-12-01 17:04

    If you'd rather avoid changing ports through MAMP or options in my.cnf file, it might be useful to try forcing a TCP connection via the following on the command line:

    /Applications/MAMP/Library/bin/mysql -h 127.0.0.1 -P 8889 -u root

    Remembering to set the port is important if it's anything other than the mysql default of 3306.

    The -P parameter allows you to set the port.

    MAMP's default port is 8889, but you can verify what yours is set to easily via the MAMP WebStart page while MAMP is running:

    http://localhost:8888/MAMP/

    It'll look similar to this:

提交回复
热议问题