0

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)

jarlh
  • 42,561
  • 8
  • 45
  • 63
Joseph Nnanna
  • 1
  • 1
  • 1
  • 1

4 Answers4

0
mysql -uroot -p
CREATE USER 'username'@'%' IDENTIFIED BY 'password';
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON database_name.* TO 'username'@'%';
0

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'

Schlotter
  • 105
  • 1
  • 6
0

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.

0

This means that the user has no access. This can be fixed in the following ways

insert into mysql.user (Host, User, Password) VALUES ('%', 'root', password('setyourpasswordhere'));
GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION;

or if you are using SQL workbench, you can create an user under

Adminstration --> users and previlages --> click on Add account button and create a new user, with hosts as **%** and grant the previlages in Adminstrative roles, schema previalges tabs.

enter image description here

Ramya Musunuru
  • 177
  • 1
  • 5