Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Basic Install - Server crashes during startup

0 views
Skip to first unread message

Jani Tolonen

unread,
Oct 8, 2001, 4:06:20 AM10/8/01
to
Pacheco, Michael F. writes:
> Hi,
>
> Got my RHLinux box running MySQL at home was a snap - come to work and it
> will not keep the deamon running.
>
> Environment:
>
> SuSe Linux 6.4 on an HP Intel server
> gcc 2.95.2
> All installs done off the MySQL site using the Linux i386 packages rpm's
> Installed - Server, shared libraries, client
>
> The .err file says
>
> ----------------------------------------------------------------------------
> ------
> 011005 11:41:06 mysqld started
> Number of processes running now: 2
> mysqld process hanging, pid 5432 - killed
> mysqld process hanging, pid 5431 - killed
> 011005 11:41:06 mysqld restarted
> (loops numerous times then finishes with)
> 011005 11:43:40 Can't start server: Bind on TCP/IP port: Address already in
> use
> 011005 11:43:40 Do you already have another mysqld server running on port:
> 3306 ?
> 011005 11:43:40 Aborting 011005 11:43:40 /usr/sbin/mysqld: Shutdown Complete
>
> 011005 11:43:40 mysqld ended
> ----------------------------------------------------------------------------
> ---------------------------------------
> There are no other mysqld's running on the server - a netstat -an shows 3306
> clear - telnet to port gets connection refused - even rebooted the box in
> case a zombie process had the port - same result. Looked for the .sock file
> for MySQL and could not find one. A manual start of mysqld does the same
> process start and kill loop and ends with
> ----------------------------------------------------------------------------
> ----------------------------
> Can't start server: Bind on TCP/IP port: Addess already in use
> ----------------------------------------------------------------------------
> --------------------------
>
> The rpm packages do not install with a debug kernel - what are my options?
>
> Thanks Mike Pacheco

Hi Mike,

Can you please make one whole demonstration of the problem from
the scratch, e.g please do in this order:

(cl) mysql
<output>

(cl) ps uaxwww | grep mysqld
<output>

(cl) netstat -an | grep 3306
<output>

If mysqld is not running:

(cl) mysqld &
<output> Please note here; if you get errors (like cannot find
share dir, or can't find datadir, please use appropriate
options e.g. --language=... --datadir=...) until it starts or
you get some error that you cannot resolve.

When having problems, it's a good idea to try to get mysqld started
from the command line directly, without using startup scripts in
/etc/rc.d/init.d/ -directory, or safe_mysqld directly. This simplifies
the problem by dropping off other possible causes. Once you've managed
to start mysqld from the command line directly, you can try starting
it from other places.

From here it's easier to see what the problem is. The log file is
usually helpful, but, alas, the above part doesn't reveal the cause of
it.

What MySQL version are you using?

Regards,

- Jani

For technical support contracts, visit https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Jani Tolonen <ja...@mysql.com>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Helsinki, Finland
<___/ www.mysql.com

---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <mysql-th...@lists.mysql.com>
To unsubscribe, e-mail <mysql-unsubscribe-mysql=freebsd.csie...@lists.mysql.com>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Pacheco, Michael F.

unread,
Oct 9, 2001, 12:21:57 PM10/9/01
to
Hi Jani,

Thanx for the Reply.

Have tried both 3.23.42 and 3.23.43 - rpm packages from the mysql.com site.
----------------------------------------------------------------------------
---
root@elcombbs:/usr/bin > ./mysql
ERROR 2002: Can't connect to local MySQL server through socket
'/var/lib/mysql/m
ysql.sock' (111)

root@elcombbs:/usr/bin > ps uaxwww |grep mysqld
root 29780 0.0 0.0 1252 496 pts/0 S 10:28 0:00 grep mysqld

root@elcombbs:/usr/bin > netstat -an|grep 3306 (No return)

root@elcombbs:/usr/sbin > mysqld &
[1] 29806
Fatal error: Please read "Security" section of the manual to find out how to
run
mysqld as root!
root@elcombbs:/usr/sbin > 011009 10:30:08 Aborting

011009 10:30:08 mysqld: Shutdown Complete


[1]+ Exit 1 mysqld

mike@elcombbs:/usr/sbin > 011009 10:30:53 Can't start server : Bind on unix
soc
ket: Permission denied
011009 10:30:53 Do you already have another mysqld server running on
socket: /v
ar/lib/mysql/mysql.sock ?
011009 10:30:53 Aborting

011009 10:30:53 mysqld: Shutdown Complete


[1]+ Exit 1 mysqld
mike@elcombbs:/usr/sbin >

safe_mysqld --skip-grant-tables &
[1] 29829
root@elcombbs:/usr/sbin > Starting mysqld daemon with databases from
/var/lib/my
sql

root@elcombbs:/usr/sbin > ps -ef|grep mysqld
root 29829 29828 0 10:36 pts/0 00:00:00 sh /usr/bin/safe_mysqld
--skip-g
rant-tables
mysql 29845 29829 0 10:36 pts/0 00:00:00 /usr/sbin/mysqld --basedir=/
--d
atadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/elcombbs.pid
--skip
-locking --skip-grant-tables
mysql 29847 29845 0 10:36 pts/0 00:00:00 /usr/sbin/mysqld --basedir=/
--d
atadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/elcombbs.pid
--skip
-locking --skip-grant-tables
mysql 29848 29847 0 10:36 pts/0 00:00:00 /usr/sbin/mysqld --basedir=/
--d
atadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/elcombbs.pid
--skip
-locking --skip-grant-tables

----------------------------------------------------------------------------
-----------

Can only get mysqld to run from the safe_mysqld --skip-grant-tables command
line and options.

Can run "mysql -u root mysql" after that and get to the mysql prompt - but
I'm lost from there - looking through the mysql_install_db script - I'm just
not sure what commands out of the script to run to finish the install.

Mike

Hi Mike,

(cl) mysql
<output>

Regards,

- Jani

<mysql-unsubscribe-MPacheco=elco...@lists.mysql.com>

Jani Tolonen

unread,
Oct 9, 2001, 4:24:51 PM10/9/01
to
Hi Michael,

Pacheco, Michael F. writes:
<cut>


> root@elcombbs:/usr/bin > ps uaxwww |grep mysqld
> root 29780 0.0 0.0 1252 496 pts/0 S 10:28 0:00 grep mysqld

This indicates that there is no mysqld running.

> root@elcombbs:/usr/bin > netstat -an|grep 3306 (No return)
>
> root@elcombbs:/usr/sbin > mysqld &
> [1] 29806
> Fatal error: Please read "Security" section of the manual to find out how to
> run mysqld as root!

Have you read the security section as adviced above? You can start the
server as any user (including root) if you specify option
--user=... The above error is there to prevent starting MySQL daemon
accidently as user 'root', because that is a potential security risk.

Without --user -option mysqld tries to start as the user who is
calling it.

Fix: mysqld --user=mysql (if user 'mysql' is available, or use
another UNIX account), or even mysqld --user=root, if you don't care
about the security issue.

<cut>


> mike@elcombbs:/usr/sbin > 011009 10:30:53 Can't start server : Bind on unix
> soc ket: Permission denied
> 011009 10:30:53 Do you already have another mysqld server running on

> socket: /var/lib/mysql/mysql.sock ?


> 011009 10:30:53 Aborting
>
> 011009 10:30:53 mysqld: Shutdown Complete

The above aborting is most likely caused by the fact that you
are trying to start mysqld as user 'mike' and there is an old
socket file '/var/lib/mysql/mysql.sock', which is owned by 'root'
(or other unix user, other than 'mike'), so 'mike' cannot replace
it with the new one.

An old, unused socket file can remain in the directory, if mysqld
was not shutdown cleanly.

Fix: remove the file /var/lib/mysql/mysql.sock and try again.

> [1]+ Exit 1 mysqld
> mike@elcombbs:/usr/sbin >
>
> safe_mysqld --skip-grant-tables &
> [1] 29829
> root@elcombbs:/usr/sbin > Starting mysqld daemon with databases from
> /var/lib/mysql

This works, because safe_mysqld is automatically passing option
--user=mysql to the mysqld, and, because you are calling safe_mysqld
as 'root', who is allowed to remove the socket file. It will most
likely be owned by user 'mysql' now.

But now you are running mysqld without grant tables, so anyone
can connect to it. Please see MySQL manual about this option.

> Can only get mysqld to run from the safe_mysqld --skip-grant-tables command
> line and options.
>
> Can run "mysql -u root mysql" after that and get to the mysql prompt - but
> I'm lost from there - looking through the mysql_install_db script - I'm just
> not sure what commands out of the script to run to finish the install.

You must run, after installing MySQL, once script mysql_install_db.
This will install the grant tables. Otherwise you won't be able to
start mysqld without option -Sg (--skip-grant-tables)

> Mike

Regards,

- Jani

For technical support contracts, visit https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Jani Tolonen <ja...@mysql.com>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Helsinki, Finland
<___/ www.mysql.com

---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <mysql-th...@lists.mysql.com>

0 new messages