LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Changed my root user access for mysql access to Any from localhost (https://www.linuxquestions.org/questions/linux-server-73/changed-my-root-user-access-for-mysql-access-to-any-from-localhost-868481/)

SSBN 03-14-2011 09:04 AM

Changed my root user access for mysql access to Any from localhost
 
I did something silly and changed my root user access for mysql access to Any from localhost using webmin. I get an access dented when i try to open up the mysql editing page on webmin. Can any of you tell me if there is a way to change it back to hosts=localhost I am using webmin 1.5.30 on Centos 5.5. I am hoping i can change it by command line or if i can access the config files and change it that way?

lrtward 03-14-2011 12:38 PM

Can you run mysql from the command line? If so, check to see if you only have one entry for 'root' in your mysql database, in the user table. You can check it with:
Code:

# mysql -u root -p
<enter password when prompted>
mysql> use mysql;
mysql> select host, user from user;

If you only have an entry for 'root'@'%', then create a new entry for 'root'@'localhost' with the grant command.
Once you've verified root@localhost works, then you can drop root@%

Or if you see that you do have an entry for 'root'@'localhost' and you need to change your root password, see the article at http://www.howtoforge.com/setting-ch...root-passwords

SSBN 03-14-2011 02:25 PM

Quote:

Originally Posted by lrtward (Post 4290450)
Can you run mysql from the command line? If so, check to see if you only have one entry for 'root' in your mysql database, in the user table. You can check it with:
Code:

# mysql -u root -p
<enter password when prompted>
mysql> use mysql;
mysql> select host, user from user;

If you only have an entry for 'root'@'%', then create a new entry for 'root'@'localhost' with the grant command.
Once you've verified root@localhost works, then you can drop root@%

Or if you see that you do have an entry for 'root'@'localhost' and you need to change your root password, see the article at http://www.howtoforge.com/setting-ch...root-passwords

That did the trick thanks for the help. The last time I asked a question online about linux was 2006. Good to see the help is still top notch from the user base.


All times are GMT -5. The time now is 01:23 AM.