1

I have been researching this for close to 4 hours but still, I can't connect my Invision Community 4 forum to my mysql ran on localhost with xampp.

I can connect from the shell, but I can't connect to it from elsewhere.

Access denied for user 'root'@'localhost'

patrick
  • 59
  • 7
  • maybe you need a password? – nbk Nov 18 '22 at 17:48
  • root has no password set, but even if I set one, it wont let me – patrick Nov 18 '22 at 17:49
  • you tagged it xampp so you must have installed it with a roorpassword, if you used the mysql installer you still was prompted to enter a password, the same goes safe installation script. 'Maybe start from the start and import the database after you can access , which begs te question how dod you import the database – nbk Nov 18 '22 at 17:52
  • I don't really know what you are referring to... I installed xampp and started an apache and mysql server. That's it. – patrick Nov 18 '22 at 17:55
  • the root password is empty see https://kinsta.com/knowledgebase/xampp-mysql-password/ – nbk Nov 18 '22 at 18:11
  • Still, access denied. – patrick Nov 18 '22 at 18:15
  • run as then link shows the console from the xampp gui the re you should be logged in, from there you can follow the concepts that are presented in the link – nbk Nov 18 '22 at 18:17
  • But I still get access denied – patrick Nov 18 '22 at 18:18
  • Does this answer your question? [ERROR 1698 (28000): Access denied for user 'root'@'localhost'](https://stackoverflow.com/questions/39281594/error-1698-28000-access-denied-for-user-rootlocalhost) – Tangentially Perpendicular Nov 19 '22 at 00:46

3 Answers3

0

I think that remote root access is disabled by default. Run this SQL command via the shell:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION; FLUSH PRIVILEGES;

IT goldman
  • 14,885
  • 2
  • 14
  • 28
  • Hey! Got an error when running FLUSH PRIVILEGES `ERROR 1030 (HY000): Got error 176 "Read page with wrong checksum" from storage engine Aria` – patrick Nov 18 '22 at 20:13
  • i don't know. a search yields this [answer](https://stackoverflow.com/a/61849288/3807365) so it might help – IT goldman Nov 18 '22 at 20:24
0

Most likely you don't have the other "IPs" (like localhost) defined. Follow these steps to fix it:

  1. Execute this query: SELECT `Host`, `Password` FROM `mysql`.`user` WHERE USER = 'root';
  2. Check results, in this example the pc host has no password:
Host Password
localhost *81F5E21E35407D000A6CD4A731AEBFB6AF209E1B
pc
127.0.0.1 *81F5E21E35407D000A6CD4A731AEBFB6AF209E1B
% *81F5E21E35407D000A6CD4A731AEBFB6AF209E1B
  1. Check how are you connected: SELECT CURRENT_USER();:
CURRENT_USER()
root@localhost
  1. Now you know how you are connected and if all the user/host pairs share the same password or not, and maybe update the one that you want to change.
Matias P.
  • 64
  • 4
0

you need to go to phpmyadmin - from there go to user accounts on the top menu : phpmyadmin now click the root account that has password set to yes next to it by clicking the usernameitself : the root user with password

mysql - changing the root password - set it to no

after you enter the edit screen you will see an option "change password" on to and now you can select "No password" : select change password from top

now select no password : set no password for the root

and save the query - you will no be able to login with only the host and username - hope it helps anyone :)