Cannot connect to MySql server on Fedora linux

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have just installed MySql version 5.0-18 on Red Hat Fedora Core 4. It
is running but I cant connect to it using MySql Query Browser running
on my pc.

Quoted text here. Click to load it

Should this be garbled ? or is there a problem ?

How can I go about investigating this ? cause it could be a unix or
mysql server issue.

Here is the output of the msyqladmin -version command:

Server version          5.0.18-standard
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /var/lib/mysql/mysql.sock
Uptime:                 2 days 3 hours 31 min 46 sec



Re: Cannot connect to MySql server on Fedora linux

Quoted text here. Click to load it

This is normal. The MySQL service is intended to respond to a specific
protocol, shared by the MySQL client.  It is not human-readable.

The fact that you can get a response at all when you telnet from the client
to the server on that port indicates that the MySQL server is probably fine.

When you say you can't connect with MySQL Query Browser, what error do you
get?  I'm guessing that you don't have a MySQL account defined on the server
that permits your client PC to connect.

See thread "ODBC not connection to database" on this newsgroup, a couple of
days ago.  Your situation is probably very similar.

Bill K.

Re: Cannot connect to MySql server on Fedora linux

Bill Karwin wrote:
Quoted text here. Click to load it

Thanks for this.

I checked out this post and suggestion re. privileges and I have the
privileges for root with the host = "%", with the same values for my
user id. But still cannot connect using Query Browser.

I can log in locally when I am on the same box as root and other users.
But not from a remote box. I am running Query Browser which asks for
the host/user and password. The error message is
MySQL Error Number 1045
Access denied for user 'root'@'<hostname>.localdomain' (using

As stated, I can telnet to the mysql server/port and get a reply back.

I dont have the mysql client on my pc. I guess I should try that also.


Re: Cannot connect to MySql server on Fedora linux

When you changed the privileges,
did you make the flush privileges which is required?
a restart to the mysql server?

Re: Cannot connect to MySql server on Fedora linux

Quoted text here. Click to load it

Are you using the same password that you use when you connect on the local

Also try this test on the Linux machine:
    mysql -h <hostname> -u root -p <databasename>

Enter the actual hostname of the Linux server, not 'localhost'.  This should
connect via a network connection, overriding the local-access method that
uses IPC.  It'll ask for a password (due to the -p option).  Enter the same
password you used in Query Browser.

The test is important because you could have different passwords for one
MySQL account, in this instance root.  You can even have different passwords
per remote host.  MySQL will use the entry where the host most
"specifically" matches the remote hostname.  So an entry for
'root'@'hostname' will match before 'root'@'%'.  Each entry can have
distinct passwords (or no passwords).

You could also have distinct privileges and passwords per database.  MySQL's
privilege system is very flexible -- perhaps too flexible!

Another user (m6s) suggests using FLUSH PRIVILEGES when you change
privileges in the mysql system database.  You don't need to do this if you
use GRANT & REVOKE statements; you need to do this only if you execute
INSERT/UPDATE/DELETE statements directly against the mysql system tables.

Bill K.

Re: Cannot connect to MySql server on Fedora linux

Currently the users for this server have passwords set in the user
table with host == "%" only. No other hosts or localhost is mentioned:
| %    | root  | asldkfja;lskfjd |
So this should mean that the host is a wildcard i.e. all.
I will add in a localhost entry once I can log in remotely.

However, my host doesnt have a hostname. So I gave a name to the host
and tried logging using mysql.exe client into the server two ways

1) without the -h : I can still log into server locally.
2) with the -h and the new host name: I still get the login error
ERROR 1045 (28000): Access denied for user 'root'@'NYDBS1P.localdomain'
(using password: YES)

I added an entry on the localhost with its own ip and name in it and
tried the -h line again. Still the same error. I will try re-booting
the machine and then trying again.

Site Timeline