?
Solved

Locked out of MYSQL and PLESK 7 due to an incorrect allowed host setting in MYSQL on 'admin'

Posted on 2004-11-26
3
Medium Priority
?
1,225 Views
Last Modified: 2008-01-09
Here's the deal.... I have a default Plesk install at my host provider on *nix. I use Navicat 2004 to connect to my MYSQL DB. Since the deafult admin MYSQL login only allows a login from host 'localhost', I used phpMyadmin to set the allowed 'admin' login host to '*', this change has completly locked my out of EVERYTHING!!! Plesk, phpMYAdmin, Navicat.. EVERYTHING!!! Here are my errors:

Plesk login: Unable to connect to database: saved admin password is incorrect. 0: /usr/local/psa/admin/auto_prepend/auth.php3:2 psaerror(string "Unable to connect to database: saved admin password is incorrect.")

===================================================

phpMyAdmin: phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server.

Error

MySQL said:
#1045 - Access denied for user: 'admin@localhost' (Using password: YES)

===================================================

I am unable to reboot my server. I know the problem is with the allowed "host" setting. I know the problem lies in how I tried to set the host to allow from '*'. So what I need to do is fix that setting so I can connect again. I am still able to connect via SSH using puTTY. I have root access. I believe I need to edit a mySQL config file to ignore grant tables and restart the mySQL service. I do not know how to do this. I need help, without help I'm sure I'll pay several hundred dollars to pay the support team at my ISP. Please help!!!
0
Comment
Question by:blaines
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
AdrianSRU earned 2000 total points
ID: 12686320
If you start the server with the option:
--skip-grant-tables
you will be able to connect.

You can also put a line into your config file (http://dev.mysql.com/doc/mysql/en/MySQL_Cluster_Config_File.html):
[mysqld]
skip-grant-tables

After you are connected, set the host value for the user to '%'.  '%' is the wildcard character in MySQL.


Hope this helps!

-Adrian
0
 
LVL 3

Author Comment

by:blaines
ID: 12687308
How do I start the server with --skip-grant-tables? Or how do I edit the config file. I'm new to *nix.
0
 
LVL 3

Author Comment

by:blaines
ID: 12687464
Okay, I figured out how to edit the my.cnf (vi my.cnf) and how to restart MYSQL via SSH (/etc/init.d/mysqld restart). I was unable to modify the allowed host via the "priviledges" in phpmyadmin (it kept returning an "unknown command"), however, I was able to browse to the mysql database and modify the 'admin' user in the 'users' table. It appears everything is working again. Thanks for all your help.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, we’ll look at how to deploy ProxySQL.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month14 days, 4 hours left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question