Bug #488 Enhance http://www.mysql.com/doc/en/Access_denied.html for novices
Submitted: 23 May 2003 22:57 Modified: 8 Aug 2003 9:45
Reporter: Ralf Hauser Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S4 (Feature request)
Version:mysql-standard-4.0.13 OS:pc-linux-i686 Redhat 8
Assigned to: Paul DuBois CPU Architecture:Any

[23 May 2003 22:57] Ralf Hauser
Description:
As a mysql novice, I would like to install buzilla (http://www.bugzilla.org/docs216/html/stepbystep.html#AEN641.)

How to repeat:
I have only a user account where I install mysql on the server.

When trying to access the database with mysqlcc, I get the 
<<Host ... is not allowed to connect to this MySQL server>>
error.

Suggested fix:
Your doc page says <<You can fix this by using the command-line tool mysql (on the server host!) to add a row to the user, db, or host table for the user/hostname combination from which you are trying to connect and then execute mysqladmin flush-privileges.>> ...

While I would be able to do this via mysqlcc (I am even capable to connect to the server via an ssh tunnel  ;)  ), I have no clue how to do this with the command-line tool.

Therefore, please add an example what commands I have to enter.
[8 Aug 2003 2:49] Lenz Grimmer
Paul, can you please take a look at that?
[8 Aug 2003 9:45] Paul DuBois
Hi,

The description in the bug report seems to contain some inconsistencies. It states that when you 
run mysqlcc, you get a "host not allowed to connect" error, but later states that you can even 
connect with mysqlcc through an ssh tunnel. So it's not clear if you can use mysqlcc successfully or 
not. If you can, then you should be able to issue the appropriate GRANT statements with mysqlcc 
(for example, the GRANT statement shown in the bugzilla installation page that you reference). 
Note that the "mysql>" shown on that page is just a prompt and you should not type that in.

If you cannot use mysqlcc, then indeed you should use the mysql program. It's not clear what your 
MySQL installation looks like, however. The bug report says:

I have only a user account where I install mysql on the server.

Does that mean you have access to mysqld, the MySQL server, as well as the standard client 
programs such as mysql and mysqladmin? If so, you should be able to invoke mysql from your 
command interpreter. If not, then please install the client programs so that you have access to the 
mysql program.  Some relevant installation pages from the manual, as well as a tutorial on running 
the mysql program may be found here:

http://www.mysql.com/doc/en/Installing.html
http://www.mysql.com/doc/en/Tutorial.html

Additional information on using GRANT may be found here:

http://www.mysql.com/doc/en/MySQL_Database_Administration.html
http://www.mysql.com/doc/en/User_Account_Management.html
[10 Aug 2003 0:23] Ralf Hauser
Paul, thanks for the help. Ignore my mentioning SSL, etc. for now.

As said, I can get into the database with my GUI client and when amending the rights as per http://www.mysql.com/doc/en/Access_denied.html, the GUI client produces a statement like 

<<INSERT INTO user (Host, User, password, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv, ssl_type, ssl_cipher, x509_issuer, x509_subject, max_questions, max_updates, max_connections) VALUES ('localhost', 'root', 'mypassword', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', '', '', '', '', 0, 0, 0)>>

Most likely, this is 
1) hard just to correctly type into a command-line client without mistyping, therefore an example that can be more or less copied would be very helpful in Access_denied.html
2) probably, I have explicitely set many fields I don't have to worry about because the defaults will take care of this. Therefore, it would be useful to discuss a little bit more which fields are most needed to get myself out of the "Access Denied" situation.
[17 Jul 2010 12:54] Saurabh Gattani
I try to do mysql_connect with a valid username and password. I have granted all permissions to the database user that I am using to do mysql_connect but still i get the error saying:- [Error 1044]Access denied for user 'games_admin'@'host2.securehostplanet.com. Please help on this.