[olug] Mysql question...

Jon H. Larsen relayer at levania.org
Tue Feb 1 16:41:17 UTC 2005


On Tue, 1 Feb 2005, Collard, John wrote:

> Date: Tue, 1 Feb 2005 09:07:13 -0600
> From: "Collard, John" <John.Collard at aquila.com>
> Reply-To: Omaha Linux User Group <olug at olug.org>
> To: olug at olug.org
> Subject: [olug] Mysql question...
> 
> I've been using mysql on windows for several years.  Recently converted
> to using Suse 9.1 Pro, and installed mysql from the Suse DVD and there
> is a mysql file in /etc/rc.d.
> 
> So, How do I verify it's up? And how do I get access to it the first
> time? (to set passwords, create databases, etc.) 
On Suse:

/etc/init.d/mysql
Usage: /etc/init.d/mysql {start|stop|status|reload|restart|try-restart|force-reload}

To start, run /etc/init.d/mysql start
To stop, run /etc/init.d/mysql stop

You can use chkconfig to see what runlevels mysql runs in:

$> /sbin/chkconfig --list mysql
mysql                     0:off   1:off   2:on    3:on    4:off   5:on   6:off

To have mysql run on bootup in runlevels 3 and 5:

$> /sbin/chkconfig mysql 35


To verify if it's up:

In Suse, you should be able to do a couple things to make sure that the 
process is running.

Through the init.d startup script:

$> /etc/init.d/mysql status

Checking for service MySQL:                                          running


OR


$> ps auxw|grep mysql

root      1119  0.0  0.0  2460    4 ?        S     2004   0:00 /bin/sh 
/usr/bin/mysqld_safe --user=mysql --pid-file=/var/lib/mysql/mysqld.pid 
--socket=/tmp/mysql.sock --datadir=/var/lib/mysql
mysql     1158  0.0  0.6 142408 3588 ?       S     2004   0:25 
/usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql 
--pid-file=/var/lib/mysql/mysqld.pid --skip-locking

OR

You can also check to see if it's listening on a port:

$> netstat -an|grep 3306

tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN


OR

You can also try this:

$> telnet 0 3306

Trying 0.0.0.0...
Connected to 0 (0.0.0.0).
Escape character is '^]'.
NHost 'localhost.localdomain' is not allowed to connect to this MySQL 
serverConnection closed by foreign host.


Jon L.

-- 
Jon H. Larsen  - relayer -at- levania -dot- org
Omaha Linux Users Group - http://www.olug.org/
AnimeSunday.org - http://www.animesunday.org/
ICQ#: 10412618 - http://www.levania.org/~relayer/
GPG/PGP Pubkey - http://www.levania.org/~relayer/relayerpubkey.txt



More information about the OLUG mailing list