473,888 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MySQL stops functioning periodically - any ideas?

Hi All,

I've been trying to build a Ruby-on-Rails plus MySQL application. I'm
running Ruby 1.8.2, Rails 1.1.4 and MySQL 5.0.15-nt over
WinXP-Pro/SP2. I run under an Administrative account.

I tried building the first example from Agile Web Development with
Rails, 1st ed. Somehow the DB got corrupted and I couldn't recover.
Instead of retrying that, I tried building the first example from Ruby
For Rails, which worked fine.

So I started building my own app when a daemon attacked MySQL again.
The symptoms are:
1. The mysql client rejects root, despite the fact that My.cnf
provides root's credentials and has been working for days without
supplying a username nor password.
2. That rejection continues if I try with "mysql -u root -p" and
provide the root pswd when prompted
3. mysqladmin rejects root in the same way as mysql does. (I'm
running the server on the client machine.)
4. When I check the server with "telnet localhost 3306", I get a
trash response ... sort of an amalgamation of Arabic, Farsi and Hebrew
.... none of which I speak :-)
5. Rebooting does not change anything.
6. I stopped the server by use of Contol Panel/Computer
Management/Services' Stop command
7. Restarted server with "net start MySQL"; same rejection of root

Is it possible the password table got corrupted? Is there anyway to
delete it and re-enter the root password? Or am I unable to connect
with port 3306 somehow? How could I test that further?

Any suggestions would be greatfully received.

Thanks in advance,
Richard

Jul 27 '06 #1
4 5374
>I've been trying to build a Ruby-on-Rails plus MySQL application. I'm
>running Ruby 1.8.2, Rails 1.1.4 and MySQL 5.0.15-nt over
WinXP-Pro/SP2. I run under an Administrative account.

I tried building the first example from Agile Web Development with
Rails, 1st ed. Somehow the DB got corrupted and I couldn't recover.
Instead of retrying that, I tried building the first example from Ruby
For Rails, which worked fine.

So I started building my own app when a daemon attacked MySQL again.
Which daemon, running on which host, using what login?

Mysql will reject connections from a host if too many aborted
connections come from that host. Use "mysqladmin flush-hosts"
to reset this (if you can get connected at all, which doesn't
seem to be the case here). Are you connecting with "localhost"
or something else? I'm not sure it can lock out connections
via the local UNIX-domain socket (or does that feature even
exist on a server running on Windows?). Note that "localhost"
and "127.0.0.1" are *NOT* the same thing (on UNIX at least).

Another possibility for resetting the error is to stop the daemon
as gracefully as possible while still doing it (which may be a
reboot), and restart it WITHOUT restarting any misbehaving clients
which may be seen as "attacking" the server (leave the web server down).

Examine the error log (on my system it's in /var/db/mysql/*.err,
yours is probably different). Are you getting "host is blocked"
errors? This is my assumption, and if you aren't, my proposed
solution is less likely to work.
>The symptoms are:
1. The mysql client rejects root, despite the fact that My.cnf
provides root's credentials and has been working for days without
supplying a username nor password.
2. That rejection continues if I try with "mysql -u root -p" and
provide the root pswd when prompted
3. mysqladmin rejects root in the same way as mysql does. (I'm
running the server on the client machine.)
You can't connect to the daemon from your host. Period. Try from
a different host if you have an administrative login that will work
from a different host (you had to specifically GRANT it).
>4. When I check the server with "telnet localhost 3306", I get a
trash response ... sort of an amalgamation of Arabic, Farsi and Hebrew
... none of which I speak :-)
It's a binary protocol, and this is normal, which means the daemon
is still accepting connections.
>5. Rebooting does not change anything.
6. I stopped the server by use of Contol Panel/Computer
Management/Services' Stop command
7. Restarted server with "net start MySQL"; same rejection of root

Is it possible the password table got corrupted? Is there anyway to
delete it and re-enter the root password? Or am I unable to connect
with port 3306 somehow? How could I test that further?
On a UNIX system you can stop the daemon and restart it with
--skip-grant-tables (and probably --skip-networking if there's the
equivalent of the UNIX-domain socket connection on Windows). Then
reset the root password and restart the daemon. Beware that this
lets anyone in. I suspect the procedure is similar for Windows.
Jul 28 '06 #2
Hi Gordon,

THANK YOU!!

Thank for taking time to address all the bases. I focused on the
"--skip-grant-tables" because I recall seeing something about that. My
"Definitive Guide t MySQL 5" covered that pretty well.

So I stopped the MySQL service in the Services applet; ran MySQLd.exe
with the skip option in one Command Window. Opened a second Command
window and ran "mysql -u root". That led to a Windows Security Alert
dialog which blocked my program but allowed me to unblock it. Then I
checked with a show databases. Looks good!!

Thanks so much for giving me a simple way out of this mess. I'm
proposing to implement a client's Receivables system with Ruby on Rails
and MySQL. The first two seem to be really solid and I love them. I
love MySQL 5.0 on paper, but I got to assure myself that MySQL won't
bomb like this frequently. If you'r interested, I'll post (or mail
you) with responses to your other questions and my outcome on this
reliability issue.

With warm regards,
Richard

Gordon Burditt wrote:
I've been trying to build a Ruby-on-Rails plus MySQL application. I'm
running Ruby 1.8.2, Rails 1.1.4 and MySQL 5.0.15-nt over
WinXP-Pro/SP2. I run under an Administrative account.

I tried building the first example from Agile Web Development with
Rails, 1st ed. Somehow the DB got corrupted and I couldn't recover.
Instead of retrying that, I tried building the first example from Ruby
For Rails, which worked fine.

So I started building my own app when a daemon attacked MySQL again.

Which daemon, running on which host, using what login?

Mysql will reject connections from a host if too many aborted
connections come from that host. Use "mysqladmin flush-hosts"
to reset this (if you can get connected at all, which doesn't
seem to be the case here). Are you connecting with "localhost"
or something else? I'm not sure it can lock out connections
via the local UNIX-domain socket (or does that feature even
exist on a server running on Windows?). Note that "localhost"
and "127.0.0.1" are *NOT* the same thing (on UNIX at least).

Another possibility for resetting the error is to stop the daemon
as gracefully as possible while still doing it (which may be a
reboot), and restart it WITHOUT restarting any misbehaving clients
which may be seen as "attacking" the server (leave the web server down).

Examine the error log (on my system it's in /var/db/mysql/*.err,
yours is probably different). Are you getting "host is blocked"
errors? This is my assumption, and if you aren't, my proposed
solution is less likely to work.
The symptoms are:
1. The mysql client rejects root, despite the fact that My.cnf
provides root's credentials and has been working for days without
supplying a username nor password.
2. That rejection continues if I try with "mysql -u root -p" and
provide the root pswd when prompted
3. mysqladmin rejects root in the same way as mysql does. (I'm
running the server on the client machine.)

You can't connect to the daemon from your host. Period. Try from
a different host if you have an administrative login that will work
from a different host (you had to specifically GRANT it).
4. When I check the server with "telnet localhost 3306", I get a
trash response ... sort of an amalgamation of Arabic, Farsi and Hebrew
... none of which I speak :-)

It's a binary protocol, and this is normal, which means the daemon
is still accepting connections.
5. Rebooting does not change anything.
6. I stopped the server by use of Contol Panel/Computer
Management/Services' Stop command
7. Restarted server with "net start MySQL"; same rejection of root

Is it possible the password table got corrupted? Is there anyway to
delete it and re-enter the root password? Or am I unable to connect
with port 3306 somehow? How could I test that further?

On a UNIX system you can stop the daemon and restart it with
--skip-grant-tables (and probably --skip-networking if there's the
equivalent of the UNIX-domain socket connection on Windows). Then
reset the root password and restart the daemon. Beware that this
lets anyone in. I suspect the procedure is similar for Windows.
Jul 28 '06 #3
Hi Gordon,

Just a few words of "follow up":

I reset my root password from the mysql no-password login. I compared
the old encrypted version with the new. That hints at the possibility
that the root password had been corrupted.

But I feel it's more likely that the MySQL security scheme would
re-encrypt a new password to preclude enabling a malicious user to
generate a slew of plain- and cyber-text combinations. On the other
hand, such a user could probably figure out how to crack systems by
studying the source code or just use the "--skip-grant-tables"
convenience.

I do have to address the security issue presented by the
"--skip-grant-tables" when I recommend MySQL to clients. But that can
wait until I get my current Ruby-Rails-MySQL project working. This
issue my force me to check out ODBC and Microsoft Access.

I have gone though the full cycle of processing and everything is back
to normal. I kept a good record of all my steps in an MS Word
document. That stuff would be too long and ugly to reproduce here,
where font control, fore- and back-ground coloring is unavailable, etc.
(at least to my knowledge).

Again, thank you for your excellent advice and
Best wishes,
Richard


Gordon Burditt wrote:
I've been trying to build a Ruby-on-Rails plus MySQL application. I'm
running Ruby 1.8.2, Rails 1.1.4 and MySQL 5.0.15-nt over
WinXP-Pro/SP2. I run under an Administrative account.

I tried building the first example from Agile Web Development with
Rails, 1st ed. Somehow the DB got corrupted and I couldn't recover.
Instead of retrying that, I tried building the first example from Ruby
For Rails, which worked fine.

So I started building my own app when a daemon attacked MySQL again.

Which daemon, running on which host, using what login?

Mysql will reject connections from a host if too many aborted
connections come from that host. Use "mysqladmin flush-hosts"
to reset this (if you can get connected at all, which doesn't
seem to be the case here). Are you connecting with "localhost"
or something else? I'm not sure it can lock out connections
via the local UNIX-domain socket (or does that feature even
exist on a server running on Windows?). Note that "localhost"
and "127.0.0.1" are *NOT* the same thing (on UNIX at least).

Another possibility for resetting the error is to stop the daemon
as gracefully as possible while still doing it (which may be a
reboot), and restart it WITHOUT restarting any misbehaving clients
which may be seen as "attacking" the server (leave the web server down).

Examine the error log (on my system it's in /var/db/mysql/*.err,
yours is probably different). Are you getting "host is blocked"
errors? This is my assumption, and if you aren't, my proposed
solution is less likely to work.
The symptoms are:
1. The mysql client rejects root, despite the fact that My.cnf
provides root's credentials and has been working for days without
supplying a username nor password.
2. That rejection continues if I try with "mysql -u root -p" and
provide the root pswd when prompted
3. mysqladmin rejects root in the same way as mysql does. (I'm
running the server on the client machine.)

You can't connect to the daemon from your host. Period. Try from
a different host if you have an administrative login that will work
from a different host (you had to specifically GRANT it).
4. When I check the server with "telnet localhost 3306", I get a
trash response ... sort of an amalgamation of Arabic, Farsi and Hebrew
... none of which I speak :-)

It's a binary protocol, and this is normal, which means the daemon
is still accepting connections.
5. Rebooting does not change anything.
6. I stopped the server by use of Contol Panel/Computer
Management/Services' Stop command
7. Restarted server with "net start MySQL"; same rejection of root

Is it possible the password table got corrupted? Is there anyway to
delete it and re-enter the root password? Or am I unable to connect
with port 3306 somehow? How could I test that further?

On a UNIX system you can stop the daemon and restart it with
--skip-grant-tables (and probably --skip-networking if there's the
equivalent of the UNIX-domain socket connection on Windows). Then
reset the root password and restart the daemon. Beware that this
lets anyone in. I suspect the procedure is similar for Windows.
Jul 28 '06 #4
>I reset my root password from the mysql no-password login. I compared
>the old encrypted version with the new. That hints at the possibility
that the root password had been corrupted.

But I feel it's more likely that the MySQL security scheme would
re-encrypt a new password to preclude enabling a malicious user to
generate a slew of plain- and cyber-text combinations. On the other
I'm not sure whether MySQL uses a 'salt' like the traditional UNIX
crypt function or not (the same password may be encrypted many ways).
>hand, such a user could probably figure out how to crack systems by
studying the source code or just use the "--skip-grant-tables"
convenience.
If a user can log into the server and restart mysqld with different
options (meaning he has either 'root' (on Windows: Administrator)
or 'mysql' privileges), your security is *already* trashed. He can
grab a copy of all your files and analyze them on his own system.
Or he could delete your 'mysql' database and replace it with one
of his own (where he knows the passwords) and restart the daemon.
Or he could bring over a MySQL daemon that doesn't check passwords.
MySQL cannot protect itself against an administrator on the server.

The vulnerability window when the *real* administrator uses it and
some bad guy over the net happens to find it in that state is an
issue which can easily be worked around. If you have a "sealed
server" (nobody is allowed to log in (system logins, not database
logins) to the server machine besides admins), shut down the network
while you do this, or use --skip-networking. If you do not have a
"sealed server", then for UNIX I'd do it in single-user mode, where
the network is shut down, nobody can log in, and user's cron jobs
aren't running. I believe Windows has something similar ("safe
mode"?): no network, no other servers that might provide logins
from a remote system, mysqld started manually.
>I do have to address the security issue presented by the
"--skip-grant-tables" when I recommend MySQL to clients. But that can
wait until I get my current Ruby-Rails-MySQL project working. This
issue my force me to check out ODBC and Microsoft Access.
I'm sure Microsoft Access cannot protect against an administrator
on the server either.

The security issue is much like worrying about locking the barn door
failing to stop a horse thief from selling a horse that has already
been stolen.
>I have gone though the full cycle of processing and everything is back
to normal. I kept a good record of all my steps in an MS Word
document. That stuff would be too long and ugly to reproduce here,
where font control, fore- and back-ground coloring is unavailable, etc.
(at least to my knowledge).
The closest equivalent would be posting in HTML, which is generally
frowned upon.
Jul 28 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
1502
by: vbaspcppguy | last post by:
I cant seem to find a good sized group for mysql so I figured you guys that do PHP ought to be able to help. Problem is simple to explain, hard to figure out. Ive installed PHP and MySQL on my PC, with IIS. PHP works 100%, MySQL works with the admin tools real nice but when I try to connect to my mysql server in php the just stops... Nothing past this line
0
1236
by: jwl | last post by:
I'm having a problem with a bit of code that I have "adopted". It was partially complete when I took it over. The function of the code is to read a log file, locate files described in that log file and fill in a few tables in a couple of MySql databases. The program is using a number of std objects, hashmaps, linklists, vectors etc. It makes direct calls to the MySql api. The version of MySql is 3.23.58. Redhat 9, g++ (GCC) 3.2.2...
4
2117
by: Jeff S | last post by:
To make a long story short, let me say I had MySQL working on Windows 98 and everything was fine. Well, I took the big leap and removed all traces of Windows and Microsoft from the computer. (hooray!) Once I had Linux running OK, I downloaded and installed MySQL using an RPM package. I guess the server is running (it says it is every time the computer starts and it stops successfully every time the computer shuts down) however, I cannot...
0
1132
by: mydejamail | last post by:
I was installing a script did not want to place session variables in the standard php directory. After changing the session_save_path in the scripts .htaccess file, the mysql_connect stopped functioning, function_exists('mysql_connect') returned False. I suspect the whole mysql library stopped functioning. Is this a known bug in PHP's mysql handling? /My
0
1019
by: Ben Allen | last post by:
Hi, This maybe off-topic as it is mainly SQL, but I thought I would ask here as I have had many helpful replies from here in the past and also the query is being run from a php script (although examples here are from where I was testing it in phpMyAdmin) I'm using a piece of software called 'phpcoin' along with the popular 'IPN' mod. I am having some problem with it and have got it down to an mySQL function functioning incorrectly. ...
3
1324
by: Ben Allen | last post by:
Hi, I'm using a piece of software called 'phpcoin' along with the popular 'IPN' mod. I am having some problem with it and have got it down to an mySQL function functioning incorrectly. This is the structure of the tables involved: phpcoin_clients: Field Type Null Default cl_id int(11) No 0
0
1126
by: Mike Bridge | last post by:
Hi- I'm having some problems with postback (using .net 1.1 on XP Professional). All my postback links stop functioning after a while. After a certain point, the postback links suddenly do nothing, although everything else seems to continue working. A hard restart seems to restore postback, but only for a while. Any ideas on what might be causing this?
4
7133
by: Bob | last post by:
Hi, I would like to periodically start and stop mysql on a schedule using something like the Windows scheduler. Does anyone know a good way to do this? Thanks, Bob
3
4756
by: John | last post by:
AC2007 I changed my combo's row source and then the autocomplete stopped working. The combo is two columns, bound to the first. First column is primary key (ID). Second column is a concatenation of two fields (Descrip & UserID). When I start typing letters of an existing description (Descrip), the combo does not autocomplete. If I select a choice from the combo, it
0
9961
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9800
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11185
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10439
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9597
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7990
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5824
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3252
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.