By ac130nz
Hello I have had wordpress installed and working perfectly but today I found an error on my site saying “Error establishing a database connection” and on the wp-admin page I see this: http://i.imgur.com/Ktaurvh.png
I have had a look at this article: http://www.wpbeginner.com/wp-tutorials/how-to-fix-the-error-establishing-a-database-connection-in-wordpress/ but I don’t remember mysql database password…
I can’t even remember what I named it tho looking in my wp-config.php file I see:
define(‘DB_NAME’, ‘wordpress’); define(‘DB_USER’, ‘wordpress’);
I used a one click install and i can not remember if i set this or if its default.
Is myphpadmin down? can i check without the password? can I find the password.
I have root access. Droplet stats 512MB Ram - 20GB - SSD Disk - New York 3 - Ubuntu WordPress on 14.04
Looking in my /var/log/syslog this is all that’s there but it does seem to be today’s date.
Jun 18 06:39:01 ***sitename-censored*** CRON[13943]: (root) CMD ( [ -x /usr/lib/php5/maxlifetime ] && [ -x /usr/lib/php5/sessionclean ] && [ -d /var/lib/php5 ] && /usr/lib/php5/sessionclean /var/lib/php5 $(/usr/lib/php5/maxlifetime))
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!
This question was answered by @aguilar1181:
If you have root access, I would start by connecting to SSH and restart the server to make sure that any service gets restarted.
If you think that the info on your wp-config.php file is not correct something most of happen that change it. You can find out your DB name by SSH with the following code set
mysql -u root -ppassword SHOW DATABASESTo find out the users you can run
select * from mysql.user;Lastly to change a password for a user you can run
SET PASSWORD FOR 'user-name-here'@'localhost' = PASSWORD('new-password-here');hope this helps you figure out. Let us know if you have nay other questions
Good Luck!!
Heya,
Depending from the MySQL version the command may differ.
The syntax is as follows for mysql database server version 5.7.5 or older:
SET PASSWORD FOR 'user-name-here'@'hostname' = PASSWORD('new-password');
For mysql database server version 5.7.6 or newer use the following syntax:
ALTER USER 'user'@'hostname' IDENTIFIED BY 'newPass';
Then type this command to reload the grant tables in the mysql database:
FLUSH PRIVILEGES;
Hope that this helps!
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.