I have been so stupid to hit go at the bottom after I added a new user, deleting all users including root. I have re-installed xampp twice, tried to change the password via the xampp security, still with no success. xAmpp loads perfect on http://localhost, phpMyAdmin though shows the following error -

Error
MySQL said:

#1130 - Host 'localhost' is not allowed to connect to this MySQL server
Connection for controluser as defined in your configuration failed.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

I found a few similar posts, no one that helped me in getting to log in to MySql again.

I am running as administrator on win xp sp3, xampp shows all services running etc.

I have in the mean time tried to reset the password by using command prompt and editing the resetroot.batch file in the mysql folder. Still the problem persist.

Is there any way to delete the entire root for mysql and re-installing xampp? I don't mind what databases exist, they are all for testing anyway. I just need to get back as the super user 'root'.

Any ideas?

Dani AI

Generated

The #1130 message means MySQL no longer has an account that matches your connection’s user@host (here: root@localhost), so the server rejects the connection before it even checks a password. That also explains phpMyAdmin’s “controluser … failed” warning if its special pma account was deleted along with the others. (dev.mysql.com)

Fast, non-destructive way back on XAMPP/Windows is to recreate root with an init file (no need to wipe the data directory as mentioned). Stop MySQL from the XAMPP Control Panel, then put this in C:\xampp\mysql\reset.sql and start the server once with the init file:

-- C:\xampp\mysql\reset.sql
CREATE USER IF NOT EXISTS 'root'@'localhost' IDENTIFIED BY 'newpass';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
CREATE USER IF NOT EXISTS 'root'@'127.0.0.1' IDENTIFIED BY 'newpass';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' WITH GRANT OPTION;
FLUSH PRIVILEGES;

-- run (Administrator cmd):
"C:\xampp\mysql\bin\mysqld.exe" --init-file="C:\xampp\mysql\reset.sql"

When it’s up, stop MySQL and start it normally from XAMPP; then sign in as root. This is the Windows-documented method for restoring access without starting in insecure --skip-grant-tables mode. (dev.mysql.com)

If phpMyAdmin still complains about a missing control user, either comment out the controluser settings in config.inc.php or recreate that account (commonly pma) and grant it the minimal privileges required for phpMyAdmin’s configuration storage. (docs.phpmyadmin.net)

Tip: root@localhost and root@127.0.0.1 are distinct accounts; creating both avoids local name/host mismatches. Verify with SELECT User,Host FROM mysql.user;. (dev.mysql.com)

Finally, ’s Skype/port 80 tweak affects Apache/phpMyAdmin’s web UI. The MySQL server listens on 3306, so port-80 conflicts won’t fix a #1130 privilege problem. (dev.mysql.com)

Recommended Answers

All 4 Replies

You can delete all your mysql data by deleting the "data" directory in \xampp\mysql (at least that's the path in my installation). The access restrictions are stored in a database named mysql, so when you delete and re-install it you should be back on square 1.
This has nothing to do with any windows administrator privileges - mysql maintains its completely independent access restriction system.

commented: Thanks, but I got this solved... +6

I did that, uninstalled xampp, made sure that mysql is completely deleted as well as the xampp folder. I then re-installed the entire app, apache, xampp and mysql using xampp. I still can't get in.

It seems that the mysql root folder stays intact. Any way to delete that?

I have managed to solve this!!!!

For future readers, if you are running Skype, open the connections configurations and de-select the check box that wants to share port 80.

Also make sure that port 80 is added to your firewall or that your anti virus is allowing the listening on port 80.

Now I can work again.;)

dude seriously, good work

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.