By Mohit Pandey
I was facing some issue with mysql so I had uninstalled it completely and then reinstalled it again.
So, when I went to my website now it was giving me “Error Establishing Database Connection”
Just to confirm everything I check show databases on sql
And I got this output:
mysql> show databases;
--------------------
| Database |
--------------------
| information_schema |
| mysql |
| performance_schema |
| sys |
--------------------
instead of this:
mysql> show databases;
--------------------
| Database |
--------------------
| information_schema |
| mysql |
| performance_schema |
| sys |
| wordpress |
--------------------
I don’t why this is happening even though I can see wordpress file in /var/lib/mysql/
Does anyone what is causing this issue? And how can I resolve it?
Thanks!
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!
Hello,
Would you mind sharing more information on how did you restore the database after reinstalling the MySQL service?
Usually what I would personally do is:
create database wordpress;
.sql backup:mysql -u your_database_user -p wordpress -h localhost < your_backup_file.sql
Let me know how this goes.
Best,
Bobby
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.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.