简体   繁体   中英

CakePHP 3: Moved datadir/socket for mysql, now getting SQLSTATE error

I recently moved my mysql database onto a larger partition. To do this I updated the my.cnf file and updated the datadir and socket values then added the following.

[client]
socket=/same/as/socket/path

And then restarted the mysql server.

I'm able to access my database manually, and none of my schema nor credentials have changed. I'm using CakePHP 3 and when I attempt to access the main page I get:

Error:SQLSTATE[HY000] [2002] No such file or directory

In my config file, I've tried setting quoteIdentifiers => true but it has no impact.

I ended up needing to edit my php.ini with the new location of the mysql socket. I'm using php-fpm, and had to restart that once the php.ini was updated.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM