By eramedia
Hi, I just follow this tutorial to change mysql data directory to new location https://www.digitalocean.com/community/tutorials/how-to-change-a-mariadb-data-directory-to-a-new-location-on-centos-7
Now mysql is running in the new location, but my application still unable to connect to the mysql server with this error:
A PHP Error was encountered
Severity: Warning
Message: mysqli::real_connect(): (HY000/2002): Connection refused
Filename: mysqli/mysqli_driver.php
Line Number: 201
I tried to login via PHPMyAdmin got this error:
#2002 - Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) — The server is not responding (or the local server's socket is not correctly configured).
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Based on what you’ve described, I am guessing that you did not set the permissions and ownership of the files you copied over. Using chown and chmod you should reset the permissions and ownership for all files you copied over so that they match the defaults from your old server.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.