469,929 Members | 1,386 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,929 developers. It's quick & easy.

How do I start MySQL?

I am a relative newbie to MySQL. I had a Postfix+Courier+MySQL mail
server running for several months. It took me a week or so to get it up
and running in September. Now, I did a clean upgrade to Mandrake 9.2
and am reinstalling everything. This thing is kicking my ass and I
can't seem to get past it. I could really use some help if anybody has any.

Just for reference, this was my primary source for information on
installation and setup, though I've been scouring Google for help:

Of course, there's also the MySQL manual:

I am trying to get MySQL to start automatically at boot. Initially it
did start, but it was a runaway process -- mysqld_safe and mysql process
apperared in the process table, died and respawned quickly soaking up
100% of my CPU processor cycles (see below). I'm not sure what caused
it to stop initializing on boot, but there was a lot of configuration
done with Postfix and Courier-IMAP.

I've copied mysql.server to the /etc/rc.d/init.d directory. It didn't
help. I have worked with "chkconfig" and it hasn't helped. As you can
see from this fragment of "chkconfig --list", it is in the list to run
under inits 2-5, but it just doesn't start.

[root@adamsmdk courier]# chkconfig --list
httpd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
sendmail 0:off 1:off 2:on 3:on 4:on 5:on 6:off
postfix 0:off 1:off 2:on 3:on 4:on 5:on 6:off
courier-imap 0:off 1:off 2:on 3:on 4:on 5:on 6:off

If I start the MySQL server through Webmin or at the command line
(/etc/rc.d/init.d/mysql start), the process runs away just as it did
when it used to start at boot. -- I get a series of instances of mysqld
and mysqld_safe in the process tables that take turns spawning and
dying, and constantly soak up processor cycles thrashing around. It's
very hard to kill this process. I have to execute "/usr/sbin/mysqld
stop" repeatedly and rapidly at the command line as root to shut it down.

If I start the server at the command line as root with "mysqld_safe
--skip-grant-tables &" I get a polite set of 3 instances of mysql and
one mysqld_safe. They appear to function normally, but webmin reports
that mysql server is not running and can't start it -- reports no error,
just that it isn't running and database list can not be retrieved. I
assume that for whatever reason, Webmin can't see the process running.

Stopping this server is also next to impossible. When I issue "mysqld
stop" at the command line (root or user) I get:

[madams@adamsmdk init.d]$ /usr/sbin/mysqld stop
040101 22:22:41 Can't start server: Bind on TCP/IP port: Address
already in use
040101 22:22:41 Do you already have another mysqld server running on
port: 3306 ?
040101 22:22:41 Aborting

040101 22:22:41 /usr/sbin/mysqld: Shutdown Complete

This does not alter the process in the proc. table:

[madams@adamsmdk init.d]$ ps -aux|grep mysql
Warning: bad syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
root 24677 0.0 0.2 2456 1256 pts/4 S 22:13 0:00 /bin/sh
/usr/bin/mysqld_safe --skip-grant-tables
mysql 24693 0.0 0.5 13600 2624 pts/4 S 22:13 0:00
/usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql
--pid-file=/var/lib/mysql/adamsmdk.pid --skip-locking --skip-grant-tables
mysql 24694 0.0 0.5 13600 2624 pts/4 S 22:13 0:00
/usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql
--pid-file=/var/lib/mysql/adamsmdk.pid --skip-locking --skip-grant-tables
mysql 24695 0.0 0.5 13600 2624 pts/4 S 22:13 0:00
/usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql
--pid-file=/var/lib/mysql/adamsmdk.pid --skip-locking --skip-grant-tables
madams 24823 0.0 0.1 1828 608 pts/0 R 22:25 0:00 grep mysql

"Killing" the process as root also has no effect. I have to use the
command line buffer to stuff "mysqld stop" from 3 to 30 times in rapid
succession or sometimes this works:

[root@adamsmdk madams]# mysqld_safe stop
Starting mysqld daemon with databases from /var/lib/mysql
040102 12:56:47 mysqld ended

[root@adamsmdk madams]# mysqld_safe stop
Starting mysqld daemon with databases from /var/lib/mysql
/usr/bin/mysqld_safe: line 1: 25790 Killed nohup
/usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql
--pid-file=/var/lib/mysql/adamsmdk.pid --skip-locking stop
/var/lib/mysql/adamsmdk.err 2>&1

040102 12:56:52 mysqld ended

Notice that I had to send that command twice.

I tried mysql_fix_privilege_tables --password=root_password and thought
that fixed it. But it did not. I uninstalled and reinstalled all the
MySQL elements it -- no change.

How can I start this thing so that it runs properly and how can I get it
to do so automatically at boot?



Jul 19 '05 #1
0 5613

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Mark Adams | last post: by
reply views Thread by Massimiliano Marcon | last post: by
2 posts views Thread by Derek | last post: by
13 posts views Thread by sandwich_eater | last post: by
4 posts views Thread by Bob | last post: by
reply views Thread by rabbit | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.