Hi Selfhelp,
For this problem, probably the easiest thing to do is just to give you
the SQL commands to issue to the MySQL server to allow it to accept
connections.
http://www.mysql.com/doc/en/Connection_access.html - "A common
misconception is to think that for a given user name, all entries that
explicitly name that user will be used first when the server attempts
to find a match for the connection. This is simply not true. The
previous example illustrates this, where a connection from
thomas.loc.gov by jeffrey is first matched not by the entry containing
'jeffrey' as the User field value, but by the entry with no user
name!"
So, in this case, 'tim' is not matched by 'tim' but by the blank user
account that has no access to the database.
Issue the following commands..
# mysql mysql
mysql> delete from mysql.user where host = "symysql" and user = "";
One other issue with RedHat 8.0 seems to be found here:
http://www.weberdev.com/phorum/read.php?f=2&i=1563&t=1562
Basically, there seems to be an incompatibilty with a particular
version of glibc. You'll probably want to download the
newest/greatest/latest MySQL from http://www.mysql.com and ALSO run:
# up2date -u
to update your RedHat system to the latest service releases. That
alone may fix the problem.
To download the files from mysql, visit these links:
http://www.mysql.com/Downloads/MySQL-3.23/MySQL-3.23.53a-1.i386.rpm
http://www.mysql.com/Downloads/MySQL-3.23/MySQL-client-3.23.53a-1.i386.rpm
You'll have to choose a download site closest to where you live, but,
that will give you the right files to download.
To install, type:
# rpm -Uvh MySQL-*3.23.53a*.rpm
if it fails for whatever reason, replace the command with:
# rpm -Uvh --nodeps --force MySQL-*3.23.53a*.rpm
(It is also possible that the FiLe CaSe of the file is different: make
sure that if you downloaded the files as 'mysql-*' instead of
'MySQL-*' that you type the case correctly. Linux is of course case
sensitive for filenames.)
Hope this helps. If it doesn't, please post a request for
clarification and I'll try to give you some other options.
Thanks again,
Legolas-ga
Search terms used:
Lost connection to MySQL server during query
I also went to http://www.mysql.com and viewed the online
documentation. I specifically looked for:
User control
user
host
grant |
Request for Answer Clarification by
selfhelp-ga
on
13 Nov 2002 11:09 PST
I'm not sure you read my question carefully. I tried to write it
carefully (except for the typos.) I cannot even telnet to port 3306
(the mysql port) from a machine other then the server. This would
imply that I'm not even getting to mysql from my winME machine. So
the problem is not question of users or rights. You might also notice
that the response to the telnet session made from the server included
3.23.52 (i.e the current version of mysql I am using. But must of all
I asked for a listing of all the settings need to make a remote tcp
connect from winME to mysql on linux (e.g. a mysql record in the
services file). You did not include this at all. You just gave
suggestions of things I might try. I have spent two days trying to
get this to work. So what I am looking for now is not general
suggestions, but a detailed set of requirements from someone who is
very familar with linux. And if you look at my user table you will
see that I don't have "" user that can connect from any host. The
link you gave:
http://www.weberdev.com/phorum/read.php?f=2&i=1563&t=1562
does not appear to be related to Redhat 8.0 .
If you want to try again and answer my actual question, that would be
great. If not please set my question free and let someone else have a
try. Thanks
|
Clarification of Answer by
legolas-ga
on
13 Nov 2002 12:22 PST
I'd be happy to give you some more detail and some more possible
solutions to your problem.
Let me clarify, you do have a "" user.. You posted it yourself.
| shmysql | | | N | N | N
| N
| N | N | N | N | N
| N
| N | N | N | N |
That is a "" user. Please enter the command given to delete that line.
Second, since I have a sneaking suspicion that you do not have reverse
DNS lookup enabled for your dns zone, you will also have to type the
following command (and for the sake of simplicity, I'll add a few
commands to reset your permissions):
# mysql mysql
mysql> DELETE from db where user="tim";
mysql> DELETE from user where user="tim";
mysql> GRANT ALL ON *.* TO tim@"%" IDENTIFIED BY "yourpassword";
Please follow these directions and it should work for you. You are
able to telnet in just fine: it is not a socket issue. If it were, you
would not connect at all: you ARE connecting--it's just being closed
immediately (which is by design). If you REALLY want to test it
manually, download and install the Win32 CLIENT for MySQL and connect
using the command:
c:\> mysql mysql -h 10.1.1.1 -u tim -p
Do this after you follow the directions above. You will connect just
fine.
|
Clarification of Answer by
legolas-ga
on
13 Nov 2002 12:24 PST
If it still doesn't work for you, then I need you to post the contents of:
/etc/rc.d/init.d/mysqld
/etc/my.cnf
and run the queries:
select * from mysql.user;
select * from mysql.db;
select * from mysql.host;
Thanks
|
Clarification of Answer by
legolas-ga
on
13 Nov 2002 12:54 PST
I've found some more information for you. It is definately a crashing
mysqld. Please see:
http://www.mysql.com/doc/en/Crashing.html
To prove this to yourself, do the following:
# mysqladmin version
(note uptime)
now, try and connect
now, do
# mysqladmin version
uptime should be reset to 0 (well, however long it took to try to
connect and retype the command)
To fix it, follow the directions on the webpage above. In addition,
following my original directions to reinstall the latest/greatest
version should also fix the problem.
Thanks again for using Google Answers!
|
Request for Answer Clarification by
selfhelp-ga
on
13 Nov 2002 13:00 PST
Yes, I do have a "" user. I did not say I didn't. I said that the ""
user was not from "%" (or any) host. So "" will not try to connect
from my winME machine which is not a host that "" is allowed from.
Anyway (just to be fair) I did delete my "" users before I asked for
clarification the first time. It made no difference. I am NOT able
to telnet just fine. I can telnet to 3306 from the server that is
running Mysql. But not from my winME client. As I said before, when I
try to telnet to the Mysql port from my winME clent, I am disconnected
with no response. I should see the version number of mysql like I do
on the server, but I do not. I can start an ordinary telnet session
but I cannot talk to 3306 from a host other than the server. I have
tried everything you suggested in your clarification, but as I
expected it did no good. Somehow mysql is not listening properly to
the port. Once again, (for the third time) what I requested in my
inital question is a list of all the settings on linux that are needed
to make this connection work (including the ones I already have
correct). For example there is a skip_networking variable that must
be set to 'no' And there must be a mysql line in the services file.
I appreciate your effort. But I'm not getting this kind of detailed
answer from you.
|
Clarification of Answer by
legolas-ga
on
13 Nov 2002 13:19 PST
Have you reinstalled MySQL?
I had the same problem on my system RedHat as well. It WILL work. I
have confirmed this is the correct solution. There are no other
possible reasons why your connection is failing. Sorry, there is no
other answer..
You may have to do this:
rpm -e --force mysql
rpm -Uvh --force --nodeps MySQL*3.32.53a*.rpm
|
Request for Answer Clarification by
selfhelp-ga
on
02 Dec 2002 09:38 PST
I'm about to give up. You gave a number of suggestions, but never
answered my question (which requested a detailed list of ALL needed
settings). I'm requesting that my question be reposted.
|
Clarification of Answer by
legolas-ga
on
02 Dec 2002 10:07 PST
You've already set all the needed settings. Like I said, I have tested
this on my own machine and have found that the answer works perfectly.
The cause, as I wrote in my first correspondence is an incompatible
version of Glibc.. The fix is to either downgrade glibc or to install
the latest version of mysql. I guarantee that it does work. Like I
said, I had the EXACT same problem, and it was fixed by using the
method given to you.
You should also make sure that you use the 'up2date -u' command to
ensure that your system is up to date.
All of your settings are set correctly. The fact that you can connect
at ALL to the MySQL port indicates with 100% certainty that the
switches are CORRECTLY set. All that remains is a BUG that needs to be
fixed. This isn't your doing--it is a bug in the software and an
incompatability with glibc. Replacing MySQL with the version from
http://www.mysql.com/ WILL fix the problem.
Legolas-ga
|
Clarification of Answer by
legolas-ga
on
02 Dec 2002 10:13 PST
Selfhelp,
Have you actually tried to install the newest version from the mysql
website? If you can honestly tell me that you've done that and it
still doesn't work I will be happy to pour over my MySQL docs to give
you all the flags needed--none of which will help you however.
I know the bug, I have verified the results and can guarantee the
answer. It is 100% correct in solving your problem. I have used MySQL
in a production environment on RedHat Linux for over 3 years. I really
do know what I'm talking about--this isn't just an answer based on a
Google Search.
Legolas-ga
|
Clarification of Answer by
legolas-ga
on
02 Dec 2002 10:26 PST
Just for the sake of completeness:
Command-line-options:
--bind-address=IP
IP address to bind to.
--skip-networking
Don't listen for TCP/IP connections at all. All interaction with
mysqld must be made via Unix sockets. This option is highly
recommended for systems where only local requests are allowed.
http://www.mysql.com/doc/en/Command-line_options.html
VARIABLES:
port The value of the --port option.
socket The Unix socket used by the server.
http://www.mysql.com/doc/en/SHOW_VARIABLES.html
However, as I've said, you do not have a problem with any variables or
switches: it is a glibc incompatibility.
If you are still not happy, feel free to request a repost of your
question by contacting answers-editors@google.com
Legolas-ga
|