11

Long story short, I ended up deleting the root user from PHPMyAdmin in EasyPHP. After some researching, I used skip-grant-tables to regain database access. Now, however, I cannot do anything as the root user has 'No Privileges.'

That stated, when logged in as 'root,' I do, indeed, have the ability to create a database via SQL.

I've tried the following, and similar:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost';
FLUSH PRIVILEGES;

Still, I can't do anything. Additionally, I have this message:

The additional features for working with linked tables have been deactivated. To find out why click here.

Clicking through shows:

$cfg['Servers'][$i]['pmadb'] ...    OK
$cfg['Servers'][$i]['relation'] ... not OK [ Documentation ]
General relation features: Disabled

$cfg['Servers'][$i]['table_info'] ...   not OK [ Documentation ]
Display Features: Disabled

$cfg['Servers'][$i]['table_coords'] ... not OK [ Documentation ]
$cfg['Servers'][$i]['pdf_pages'] ...    not OK [ Documentation ]
Creation of PDFs: Disabled

$cfg['Servers'][$i]['column_info'] ...  not OK [ Documentation ]
Displaying Column Comments: Disabled
Browser transformation: Disabled

$cfg['Servers'][$i]['bookmarktable'] ...    not OK [ Documentation ]
Bookmarked SQL query: Disabled

$cfg['Servers'][$i]['history'] ...  not OK [ Documentation ]
SQL history: Disabled

$cfg['Servers'][$i]['designer_coords'] ...  not OK [ Documentation ]
Designer: Disabled

$cfg['Servers'][$i]['tracking'] ... not OK [ Documentation ]
Tracking: Disabled

Reinstalling EasyPHP doesn't fix the problem, and nothing exists in VirtualStore (as one forum post suggested). Is there a specific MySQL file I should be looking for?

Any ideas? This has really put a stop to my application development.

Thanks.

Peter
  • 4,021
  • 5
  • 37
  • 58
  • It sounds like you just need to set up the grant tables properly. If you could do me a favor and `SELECT * FROM mysql.user WHERE user = 'root'` (with --skip-grant-tables on of course) and paste what that gives you, it might help. – cHao Jan 22 '11 at 20:32
  • And you're connecting to 'localhost' when you connect? (MySQL can be obtuse sometimes; if you connect to your IP address, it likes to see you as coming from your IP rather than localhost.) – cHao Jan 22 '11 at 20:39
  • Yes. 127.0.0.1 also has all Y's. I'm running all this through EasyPHP – Peter Jan 22 '11 at 20:42
  • Interesting... PHPMyAdmin reports no privileges, but typing 'CREATE DATABASE test' actually creates a database. – Peter Jan 22 '11 at 20:43
  • Yeah, there's often a line in `mysql.db` granting anyone the permission to create a database whose name starts with (or is) "test". Speaking of, check that table for any references to `root`, or to `%` or a blank user, that has 'N' for any or all of the first five permissions (select, insert, update, create). – cHao Jan 22 '11 at 20:45
  • The only two rows are 127.0.0.1 and localhost, both with root as user – Peter Jan 22 '11 at 20:53
  • Don't forget the "with grant option". You've re-created the root user, but without the grant option, that user cannot create any other accounts. – Marc B Jan 22 '11 at 21:27

6 Answers6

21

This was super annoying.

It appears to be a bug with phpMyAdmin.

Clear your browser cookies, what's happening is phpMyAdmin has "cached" the fact that you do not (or possibly didn't have at some point) create database access.

There's no way to reset it other than deleting your cookies for phpMyAdmin in your browser window (to get a new 'session id'), or deleting the session files on the phpMyAdmin web server.

Andrew
  • 1,606
  • 1
  • 12
  • 19
  • 3
    This worked for me. I just opened the resources tab in the Chrome Developer Console (Ctrl+Shift+I) and manually deleted all the cookies on localhost. – Mustafa Alammar Jan 07 '13 at 06:05
4

If your machine has IPv6 enabled, "localhost" will resolve to ::1, rather than 127.0.0.1. This can cause issues.

Try connecting to "127.0.0.1" rather than "localhost". That ought to force mysql to authenticate by IPv4 address, so make sure 127.0.0.1 is in there.

Alternatively, if you have admin access, you can map localhost back to 127.0.0.1 in c:\Windows\System32\Drivers\etc\hosts.

cHao
  • 84,970
  • 20
  • 145
  • 172
2

cHao and Andrew's answers solved the problem for me. I reset all permissions in the MySQL db, user table, to yes. All dbs then reappeared in phpMyAdmin, but I had no 'create db' privilege there. Cleared the phpMyAdmin cookie and even upgraded phpMyAdmin with no success. Then I went into the tmp/php directory and deleted a session file I found there (named sess + random ascii), and success!

Francisco
  • 10,918
  • 6
  • 34
  • 45
Mark
  • 597
  • 5
  • 8
1

Turns out to be some sort of issue specific to Google Chrome, as it now works in IE. I'll try running CCleaner.

Thanks all.

Peter
  • 4,021
  • 5
  • 37
  • 58
  • 2
    Weird. I was having the same issue with root privs in Chrome. Upon reading this answer, I logged in with Firefox and everything is fine. This is on OSX, so I don't think it's related to anything your Windows computer. – ray Jul 18 '11 at 18:10
  • Same thing happened to me, does anybody know why or how to fix it? – Nathan C. May 23 '12 at 22:23
  • 1
    It's not a browser specific thing and it can't be. Try clearing cache and cookies. – jnhghy - Alexandru Jantea Jan 29 '15 at 08:39
0

I just experienced the same issue (lost access to my local databases). The problem does seem to be related to browsers running Gecko or similar (like KHTML... I'm on Opera). After deleting the phpMyAdmin cookie, as suggested, I still had No Privileges. So I went to localhost/xampp, then clicked on Security. On that page is a link (h-t-t-p://localhost/security/xamppsecurity.php) that took me to a page entitled Security console MySQL & XAMPP directory protection)

I left the current password field blank and entered a new password; I think I selected cookie as the PhpMyAdmin authentication method (it actually says PhpMyAdmin authentification, but hey...). Once I had submitted the password change and tried again to access phpMyAdmin, I got all my databases back and am again able to create more; the No Privileges message has disappeared!

There is still the message at the bottom saying

The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click here.

But that's another river for another time.

Ess'iele
  • 3
  • 3
0

Been stuck with this a few times over the last few years... Easiest method I've found was today whilst setting up an RPi.

From the terminal run: $sudo mysql_secure_installation and set up as appropriate for your implementation.

Then, setup user access with: $sudo mysql_setpermission this will allow you to set a super/root user.

Just follow the prompts.

Cory C
  • 125
  • 1
  • 9
  • Just checked, still works on all my linux boxes that I have mysql running on. What setup are you using? – Cory C Dec 22 '19 at 08:32