By xfabioreims
Hello there.
I’m desperately trying to troubleshoot my “Error establishing a database connection” error since even after a restart, where the memory should be empty, my website is no longer loading.
Therefore, I’ve been playing around with the mysql error file and mysql settings. I have a lot of files to choose from inside of /etc/mysql. Yet my the biggest file and only file with actual config is inside of /mysql.conf.d/ and named “mysqld.cnf”.
The problem however is, that service mysqld start ends in "Failed to start mysqld.service: Unit mysqld.service not found.
Does that mean that my 1-click wordpress installation is using mysql instead of mysqld?
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!
mysql is mysqld, specifically mysql is the application mysqld is the executable name for the service.
The /etc/mysql folder contains configuration files, /var/lib/mysql/ contains the database files, /var/log/mysql/ contains the log files…
And finally /usr/sbin/mysqld which is the actual program, which is started by a service named mysql.service
This file is located in /lib/systemd/system
If systemctl start mysql does not work, you may be missing files, configuration may be incorrect
@richieframe has mapped out the files for you nicely, now to deal with the startup issue.
Try using the command sudo systemctl start mysql to invoke a startup of the MySQL Server.
Should this fail then look for ‘ERROR’ in the mysql error log. This should be found at the path described in your configuration file.
If you get a successful startup it’s worth looking at the log anyway to ensure that there were no peripheral issues with starting MySQL. This is considered best practice.
Good luck,
Andmoo
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.