0
votes

I cannot access a MySQL database. I keep getting the error:

ERROR 1044 (42000): Access denied for user ''@localhost' to database 'bridge'.

I have tried accessing the database from my administrative account, but met with the same error. I tried deleting the database, but same issue. I'm not sure what else to do.

What's going wrong?

1
''@localhost' You have not entered a user account. Note the bit before the @ is emptyRiggsFolly
Are you doing mysql -uroot -p where root is whatever your account name should be!RiggsFolly
I tried creating a user account using "create user 'ann'@'localhost' identified by 'mypassword';" This did not work, and it said I need at least one of the user privileges for this operation. Yes I have been using "mysql -uroot -p".Maria S
You have to login with the SuperUser account root this account has ALL privilages and will allow you to create other users. But you have to login successfully to using root and its password. It may not have a password, in which case just hit enter when you get the password challengeRiggsFolly
I entered this: "mysql --user=root mysql a--password" It logged me into mysql successfully, with a huge list of commands. But at the end of the list, it went right back to C:\ . I'm not sure if I'm doing this right. Mind you, I am doing this through the command line because when entering the password in the sql client, it closes immediately. Yes, it does have a password, because I set it when I installed it.Maria S

1 Answers

0
votes

This is from our config.inc.php. Edit this document. Notice the user=root and the password '1234'. That password is my demo password, but if you are not able to connect to your localhost database, just change the password to the new password you change in the database.

Do not change anything else. You don't have to close your browser or exit from your localhost. Just refresh the browser when you change the password. I hope this works for anyone who cannot access the SQL database in localhost.

'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '1234';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';