The mysql error was: Access denied for user - php

The problem I have is that I'm still getting the message:
Site off-line The site is currently not available due to technical
problems. Please try again later. Thank you for your understanding.
If you are the maintainer of this site, please check your database
settings in the settings.php file and ensure that your hosting
provider's database server is running. For more help, see the
handbook, or contact your hosting provider.
The mysqli error was: Access denied for user 'name'#'localhost'
(using password: YES).
It happend after I accidentaly changed the password to mysql. Shortly after I'd noticed this, I reverted to the previous password which is THE SAME as the one in the settings.php file. But I still get the same message and I don't know why. Is there any other place where the password is kept? What else can be wrong?

I've found the solution to my problem. I've changed the password one more time, but now it contains only letters and digits. And now it works fine.

Related

How to get rid of error in Xampp while opening phpmyadmin

I am using Xampp that has phpmyadmin. When I try to open phpmyadmin I get this error:
mysqli::real_connect(): (HY000/1045): Access denied for user 'root'#'localhost' (using password: NO)
In my config file the password is "" so nothing basically.
I have added the screenshot as well for the error. How can I fix it? I tried all the other answer of SO but nothing worked for me.
It seems what you are really asking is how to change the root password since you dont know the one that is in place.
The error you get is simply mysql saying, "ya need a password mate"
A quick google leads me to something like this, which seems reasonable https://gist.github.com/susanBuck/39d1a384779f3d596afb19fcad6b598c
Start mysql without the grant tables and change the password. Restart it again, and you should be good to go. I do not have Xampp or Windows, so i cant try it.
The password you are looking for should be written in the mysqld.log from when it was installed. That might save you some trouble changing it. Search the log file for "temporary password"

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.

Error : (1045) Access denied for user 'root'#'localhost' (using password: NO)

This is the error I am getting when I run my php file. I have searched over the network and found some tricks to solve the error but all in vain. some of them suggested to change the username and password for the localhost server and some advised to change only the password.
I tried both and ended up crashing phpmyadmin panel. The other user suggested to change the ports of the running servers. I specifically use mamp as I am using mac os.
I tried to change the ports but nothing worked. Afterwards I looked upon many blogs and web-articles but they also proved to be the same. One site advised to change the mamp config by using the terminal application.
When I tried to change the mysql password nothing appeared on the screen and when I approached for changing the phpmyadmin password it reflected error which said that no such directory is found.
I reinstalled mamp several times but no effect.
Please answer as soon as possible because I am stuck here and no one seems to act as a savior for me.
Go to the config.inc.php file
In the file, search for the line
$cfg['Servers'][$i]['password']
and change it to
$cfg['Servers'][$i]['password']='root'
Hope it helps

mysql error 1045 access denied php

I am trying use this guys code: https://github.com/daveismynamecom/loginregister in a xampp enviroment. My first error was a connection error. It was easy to solve and just had to cahnge the connection PDO in the config file. Now I get a
SQLSTATE[HY000] [1045] Access denied for user 'database username'#'localhost' (using password: YES)
error. I have looked at every stack q&a and have not found an answer. I didnt change the code from this guys website other than the PDO. any help would be great. Also this was my first time install xampp and I didnt have msql or php before this
[edit] I have never used mysql so how would you set up root permissions and setup a root user. I can log in to the root user from the mysql console by leaving the password blank but I don't know if that is it
[edit v2] I needed to add the user :). Did not know that. but now I am getting a error code 1044 but that is a question for another time
It's not about the code itself - that error comes directly from your MySQL server. Check whether your credentials (user/pass) are correct.
[edited]
I have never used mysql so how would you set up root permissions and setup a root user. I can log in to the root user from the mysql console by leaving the password blank but I don't know if that is it
So did you set a blank password in the config file as well?

Why does MySQL always give error access denied even though user exists?

I'm trying to simply run php artisan migrate --seed on a new Laravel project but everytime I try, I get the error:
SQLSTATE[HY000] [1045] Access denied for user 'appuser'#'localhost' (using password: YES)
I check my database config file and the correct username and password for the database are there.
I check MySQL Workbench, and the correct user is there with all the schema privileges for the same password.
I tried adding the user with privileges under %, localhost and 127.0.0.1 but same access denied error.
I ran a quick check to make sure Laravel was selecting the right environment for the database connection details and it is.
I've created users hundreds of times and never had this problem. This all started after I updated to the latest MySQL Workbench 6.1.7 after the older version stopped working correctly on Windows 8. Sadly, I don't have the option to even go back and test if the old version fixes the problem since it won't work at all.
At this point I can't get any new database users to connect.
The database server is up and running, and every other previously existing user still connects just fine.
Here is the my.ini file.
Any ideas? I'm hoping I'm just tired and missing something obvious here.
by reading the config file.
[client]
password = mysql
port = 3306
socket = "{$path}/mysql/mysql.sock"
i think you need to comment the string with default password. Probaby it affects something.
I have recent MariaDB, and the password string is commented out in every config file example

Categories