Question

Message: mysqli::real_connect(): (HY000/1045)

Posted February 4, 2021 114 views
Nginx

I am unable to open my website. My website is completely down today. I am getting below error but it was working till morning and I have not done any changes in droplet or phpmyadmin level -

Severity: Warning

Message: mysqli::real_connect(): (HY000/1045): Access denied for user ‘crazydeal’@'localhost’ (using password: YES)

Filename: mysqli/mysqli_driver.php

Line Number: 201

Backtrace:

File: /var/www/html/crazydeal/application/core/MYController.php
Line: 16
Function: _
construct

File: /var/www/html/crazydeal/application/controllers/website/Home.php
Line: 15
Function: __construct

File: /var/www/html/crazydeal/index.php
Line: 316
Function: require_once

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi @Rakshakar,

From the error message, you seem to be interested most in the :

Message: mysqli::real_connect(): (HY000/1045): Access denied for user ‘crazydeal’@'localhost’ (using password: YES)

See if your user crazydeal do has access to mysql. You can do that when SSHing to your server and typing:

mysql -u crazydeal -p 

It will ask you for the user’s password. Paste it there, if you don’t remebmer it you can take it from your config file. If it doesn’t work from there, I’ll suggest changing it directly in MySQL the following way:

mysql

And then

ALTER USER 'user-name'@'localhost' IDENTIFIED BY 'NEW_USER_PASSWORD';
FLUSH PRIVILEGES;

Regards,
KFSys

  • Its not working getting error- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘USER 'crazzydeal’@'localhost’ IDENTIFIED BY 'NEWUSERPASSWORD’’ at line 1

    • Hi @Rakshakar,

      Make sure that you wrap your username and password by a ’ ’ otherwise it won’t work.

      Additionally, if your password contains ’ it will cause an incorrect syntax error as well.

Submit an Answer