LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-17-2004, 11:58 AM   #1
TBomb
Member
 
Registered: May 2004
Location: Great Britain
Distribution: Slackware
Posts: 91

Rep: Reputation: 15
MySQL - Host not allowed


I'm getting this (below) error when trying to connect to my MySQL database via an ODBC driver.

Host '10.0.0.6' is not allowed to connect to this MySQL server

I've searched the MySQL website and found the solution.

--


Code:
Host ... is not allowed to connect to this MySQL server

You can fix this by setting up an account for the combination of client 
hostname and username that you are using when trying to connect. If you 
don't know the IP number or hostname of the machine from which you are connecting, you should put an entry with '%' as the Host column value in the user table and restart mysqld with the --log option on the server 
machine. After trying to connect from the client machine, the information in 
the MySQL log will indicate how you really did connect. (Then change 
the '%' in the user table entry to the actual hostname that shows up in the
 log. Otherwise, you'll have a system that is insecure because it allows 
connections from any host for the given username.) On Linux, another 
reason that this error might occur is that you are using a binary MySQL 
version that is compiled with a different version of the glibc library than the one you are using. In this case, you should either upgrade your operating system or glibc, or download a source distribution of MySQL version and compile it yourself. A source RPM is normally trivial to compile and install, so
 this isn't a big problem.
The key points there I think are:

Code:
Host ... is not allowed to connect to this MySQL server

You can fix this by setting up an account for the combination of client 
hostname and username that you are using when trying to connect. If you don't know the IP number or hostname of the machine from which you are connecting, you should put an entry with '%' as the Host column value in the user table and restart mysqld with the --log option on the server machine.
How do I do that? The whole thing, putting an entry with % as the host column value in the user table, etc?

Last edited by TBomb; 09-17-2004 at 12:00 PM.
 
Old 09-17-2004, 02:20 PM   #2
secesh
Senior Member
 
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
MySQL privileges --

http://dev.mysql.com/doc/mysql/en/Privileges.html

User Account management --

http://dev.mysql.com/doc/mysql/en/Us...anagement.html


Hope that gets you there.mrc.
 
Old 09-17-2004, 03:18 PM   #3
TBomb
Member
 
Registered: May 2004
Location: Great Britain
Distribution: Slackware
Posts: 91

Original Poster
Rep: Reputation: 15
I'm still kind of stuck, I've never used mysql from the CL before so I've got no idea how to do any of this. I speed read through those links
but none of really meant any of it. From what I can gather, I need to edit the user tables in the 'mysql' db. I on't even know how to do that
 
Old 09-17-2004, 06:39 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
Quote:
Originally posted by TBomb
I'm still kind of stuck, I've never used mysql from the CL before so I've got no idea how to do any of this. I speed read through those links
but none of really meant any of it. From what I can gather, I need to edit the user tables in the 'mysql' db. I on't even know how to do that
Its quite easy if you know SQL.

First connect to the mysql database as root:

# mysql
>

And it should just connect and give you the > for the prompt like above. If you want to connect as an existing user with grant options/privileges you have to do a:

$ mysql -u<username> -p<password>
>

Once you are connected and have the > prompt simply select the mysql database:

> use mysql

It should tell you then if it switches the database to use.

> show tables;

That command will show you all the current tables for mysql database. If you then want to add a user with all privileges do this:

> GRANT ALL PRIVILEGES ON *.* TO 'user@hostname-or-ip' IDENTIFIED BY 'password';
> commit;

That will give the user all privileges to all the databases. If you want them to have grant options as well, do this:

> GRANT ALL PRIVILEGES ON *.* TO 'user@hostname-or-ip' IDENTIFIED BY 'password' WITH GRANT OPTIONS;
> commit;

The documentation at www.mysql.com is quite extensive and helpful. If you know nothing about SQL I'd also suggest picking up a book or reading more tutorials online. It comes handy when you don't have that GUI to help you out.

Cheers
 
Old 09-18-2004, 05:22 AM   #5
TBomb
Member
 
Registered: May 2004
Location: Great Britain
Distribution: Slackware
Posts: 91

Original Poster
Rep: Reputation: 15
Thanks, all working. I didn't see your reply until just now, but I found that this problem had already been asked (and solved)
on the devshed forums. The solution was similar (maybe the same, can't remembeR) to yours.

Thanks for the help!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Method Not Allowed: The requested method POST is not allowed for the URL /writedhcp.p WiWa Linux - Networking 15 01-06-2011 01:20 PM
ERROR 1130: Host 'testserver' is not allowed to connect to this MySQL server ddaas Linux - Software 1 04-07-2005 12:00 PM
Host XXX.XXX.XXX.XXX is not allowed to connect to this MySQL server ocavid Linux - Newbie 2 03-16-2005 09:40 AM
Linux Host no Root login allowed or so it says? Other Linux Distros? mattnedgus Linux - Newbie 6 02-24-2005 03:22 PM
MySQL - <host> could not be found Gunrunner Linux - Software 0 11-18-2004 12:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration