when using $wpdb sudden connection rejection without changing anything. Access denied - php

WP version 5.5.3 - updated days ago
php version 7.3.24
running locally on server
Can not create a backup using duplicator
Occours bothi inside WP admin pages, so internal connections and external through php requests
I am suddenly receiving the following error but have not made any changes to any file on the server, nor within wp itself -
WordPress database error: [Access denied for user 'database-name'#'localhost' (using password: YES)] .
THIGNS I HAVE DONE TO FIX -
I have verified the wpconfig password and the db password match. I actually re-updated the db by copying the password listed in the wpconfig file and pasting it to the db.
Searched a lot of solutions on here
checked that the db is up and running by logging in using MYPHPADMIN
What am I missing and how do I get to the root of the issue that is causing this? No console errors are shown.

Have you considered the possibility of for the likes of using an online SQL instance such as AWS RDS, given the correct permissions for the database to be accessed, or are you running it locally?

Related

Why am I getting so many error messages in phpmyadmin localhost?

I just set up XAMPP and, when I start the Apache localhost, it displays all of these errors when I search "localhost/phpmyadmin"
I am very new to this (just downloaded XAMPP) and I watched this tutorial: https://www.youtube.com/watch?v=hqfIksHKPPg on setting it up (I didn't install phpmyadmin since it was already installed with XAMPP)
I edited the notepad text files as stated in the video, but instead of a login, I get all of the error messages shown in the above picture...
I also opened config.inc.php and edited the line:
['Servers'][$i]['(MySQL root password)'] = '';$cfg
so it matched MySQL root password
Even if you have a suggestion to fix one of the errors, please still comment
Also, if you need any more information please let me know
You're getting several error messages because you have several problems :)
Cannot connect: invalid settings
Some setting is incorrect, most likely something in your config.inc.php is misspelled or incorrectly copied and pasted. Specifically, if the line ['Servers'][$i]['(MySQL root password)'] = '';$cfg is actually how it appears in your configuration, that is clearly the problem as the line should actually be $cfg['Servers'][$i]['password'] = 'green'; except with you password instead of 'green'...except that only applies if your auth_type is 'config', otherwise the 'password' line isn't used at all (since you're prompted for the password at log in). I'm not sure what XAMPP does here for auth_type, but I don't think you should have had to edit the configuration file at all, since you used the XAMPP installer which should have configured everything.
The server requested authentication method unknown to the client [sha256_password]
This appears to be a bit of a version mismatch in your installed files. Access denied after setting user's password with SHA256 in phpMyAdmin goes in to more detail, but this most often occurs when you've got MySQL 8 and PHP older than 7.4. Normally, I'd suggest upgrading your PHP version — but you're using the packaged XAMPP, which certainly wouldn't ship with conflicting MySQL and PHP versions, so something is odd here. Please confirm for us your MySQL and PHP versions. You didn't happen to have an existing MySQL or PHP installation before you installed XAMPP, did you?
Connection for controluser as defined in your configuration failed
This is probably related to the MySQL 8/PHP 7.4 conflict. There is an administrative user (called the controluser) that phpMyAdmin can use to manage some extra features, ordinarily you wouldn't need it to access phpMyAdmin (only to access those additional features), but it seems XAMPP has configured this for you. Since the authentication fails, you get an additional message that the controluser was not able to connect.
You could bypass this by commenting out the configuration lines referencing controluser and controlpass, although again the XAMPP package should have this all configured so I don't recommend that at this point.
The other messages are basically echoes of the previous messages; you get an additional protocol notification because the controluser is trying the same sha256 connection type that the main user was, and then finally phpMyAdmin is telling you that MySQL rejected the connection.
If this is a fresh XAMPP install, I'd suggest reinstalling, because something got a bit confused. I'd also suggest making sure that you don't have any other conflicting software running — XAMPP is a package of all the included parts, so you don't want to install or run your own Apache or MySQL instance which would interfere with the packaged kit.

Wordpress Error Establishing Database Connection

I have reinstalled phpAdmin (due to another issue) and updated wp-config with the correct names for DB, user name, password, etc, but now I cannot access the wordpress site (www.enablie.co.uk, www.enablie.co.uk/wp-admin or http://www.enablie.com/phpmyadmin).
I have tried adding the repair code
define('WP_ALLOW_REPAIR', true);
But still cannot access via : http://www.enablie.co.uk/wp-admin/maint/repair.php.
I am also getting this error when trying to access sql -
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
On Chrome is is showing a basic version of the site (broken styles) when not logged in, but get the EEDC as soon as try to log in. On Safari I have the EEDC immediately.
I assume I have just done something stupid, but most errors seem to suggest naming errors in the config file which I know is not the case. I have also checked the db still exists via mysql to ensure that there is not a problem there.
I assume that the re-install removed something from the overall settings that I now need to manually reconfigure, but I can't find any guidance that points me where to look so would appreciate some help on what I need to change. Much appreciated!
I rebooted by instance and that seemed to fix the issue.

phpMyAdmin password reset

I am running a ReadyNAS 102 and installed MySQL, PHP and phpMyAdmin to setup a database for use with OwnCloud. The first install was successful, but after forgetting some login passwords I decided to go for a full reinstall of the above.
Now, when opening phpMyAdmin, I get the following message:
#1045 Cannot log in to the MySQL server
I understand from other sites that I need to access the config.ini.php file to edit the user details manually (and reset the root), however I have no idea how to access this file on the NAS. Is there a command line access for files on the NAS?
https://www.ostraining.com/blog/coding/error-1045-phpmyadmin/

MAMP cannot connect to localhost

Big picture: trying to update a 5 year old WordPress site without losing all the calendar plug-in posts.
Macro: downloaded MAMP to setup a local test site. Cannot get past index page to connect to database.
What works:
Index page shows my test sites (I have three versions of wordpress
Installed (3.0.5 / 3.9.1.1 / 4.4.2), so I can incrementally test and
upgrade)
I can login to phpMyAdmin no problem
I exported the old database to a .sql file, then imported it up to the new Local database, it showed up fine, but tells me "Your PHP MySQL library version 5.1.73 differs from your MySQL server version 5.5.48"
The wp-config.php usernames and passwords all match to the database
After many searches and most of the day trying different things, I am stumped. Obviously, I am a complete noob to MySQL and PHP.
What I have tried:
Changing port to 90 instead of 80
Changing the user to 'root' and 'admin'
Changing from define('DB_HOST', 'localhost’); to define('DB_HOST', '86.42.246.7:80’); and define('DB_HOST', '86.42.246.7:90’);
Notes:
I initially edited the files with textedit, but noticed it was changing single quotes to leave syntax errors - now I'm using Dreamweaver.
Is it possible I could just import each table one at a time into a newly created database?
Please help me out!
EDIT
I changed the database password, but I got this error message
"phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server."

Where is /usr/local/lib on online server

I have a server hosted on 000webhost.com
In the file manager there is a public_html folder where I store my website files, but no \usr folder.
Generally I could just access this file through the command line or terminal but this is not the case on this server. Unless there are command line tools that I simply couldnt find (I know it is a linux server);
I ran phpinfo() and the configuration file path was in usr/local/lib but I have no idea how to access that.
Any ideas? Thanks in advance.
Go to http://www.000webhost.com/faq.php look at the section on connecting to MySql. Your solution is likely there.
Here is a synopsis:
If you cannot connect to MySQL server, there could be some causes:
- Incorrect MySQL hostname.
Never use 'localhost' as your MySQL hostname! You can find your MySQL hostname by logging on to members area, entering control panel and clicking on MySQL icon.
- Incorrect MySQL username / password or database name.
You can find / setup MySQL username and database by clicking on MySQL icon from control panel. And you can change MySQL password by clicking on phpMyAdmin icon.
- Database failed to setup.
In a very rare cases MySQL database can fail to setup. To confirm this, please try to enter phpMyAdmin for any database. If you see database there, that means it setup was successful. And if you get access denied error by trying to enter phpMyAdmin, please delete the database and setup the same MySQL database again.
Please note that always you must give about 1 minute for any changes to apply on server.
If you still unable to connect to MySQL you check if it is server or your script problem in this way: if you can enter phpMyAdmin and see you database there, that means everything is working fine on our side. It's a problem with your PHP script.

Categories