I created my database offline using XAMPP. After uploading my site, I imported my database into server PHPmyadmin. Yet when if i load my website it will deny me access to the database displaying this error message:
Failed to connect to MySQL: Access denied for user 'everjoe'@'localhost' (using password: YES)
CodePudding user response:
mysql -uroot -p
CREATE USER 'username'@'%' IDENTIFIED BY 'password';
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON database_name.* TO 'username'@'%';
CodePudding user response:
So could you check, if your Server of the Website is allowed in the SQL-Server, you can check that on the sql-console with the following command.
SELECT Host, User FROM mysql.user;
See here https://mariadb.com/kb/en/create-user/#host-name-component for detailed information.
If there is still a Problem, maybe it is your /etc/mysql/my.cnf
-File
See here: MySQL Error: : 'Access denied for user 'root'@'localhost'
CodePudding user response:
The problem here is incorrect username and password, check your username and password details again
You could also go to c:\xampp\phpmyadmin\config.inc.php
Check for
$cfg['Servers'][$i]['user']
and $cfg['Servers'][$i]['password']
You should see your phpmyadmin username and password.