LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-10-2003, 07:37 AM   #1
WorldBuilder
Member
 
Registered: Mar 2003
Location: Massachusetts, USA
Distribution: RH 8, Solaris, Windoze eXPunged
Posts: 520

Rep: Reputation: 30
I want MySQL to run at startup


Hi all,

I have installed MySQL onto my RedHat 8 machine. I would like the mysql daemon (mysqld) to automatically run at startup. In /etc/rc.d/rc3.d, what wouls need to go there? What kind of file? I know that all the "startup" files begin with "S" and in /etc/rc.d/rc6.d and /etc/rc.d/rc0.d all the stop daemon files are "K" files. What would I name the startup file for MySQL, and what would the file contain? Right now, I start the MySQL daemon manually with the command:

"mysql.server start" from anywhere in the system.

Oh, and in the startup directiries, what do all the numbers mean, like S35httpd and S45named. What do the 35 and 45 mean? Each startup file has a differnet number, but some are shared! Thanks guys!

Chris
 
Old 06-10-2003, 10:43 AM   #2
hitesh_linux
Member
 
Registered: Dec 2001
Location: /root
Distribution: FreeBSD,NETBSD,redhat
Posts: 472

Rep: Reputation: 30
Hi cjwsb,

to start all service here the command,

with 'chkconfig ' command you can add,remove,and change services;list

eg:
#/sbin/chkconfig --list sendmail
sendmail 0:off 1:off 2:on 3:on 4:on 5:on 6:off

that mean sendmail confgiured to all run level.
and if you want to turn off for runlevel 4,then

# /sbin/chkconfig --level 4 sendmail off

same substituting with on and off.

with chkconfig can aslo add or delete services with the --add and --del switchs.

for more info see man pages

Hitesh

Last edited by hitesh_linux; 06-10-2003 at 10:45 AM.
 
Old 06-10-2003, 08:18 PM   #3
WorldBuilder
Member
 
Registered: Mar 2003
Location: Massachusetts, USA
Distribution: RH 8, Solaris, Windoze eXPunged
Posts: 520

Original Poster
Rep: Reputation: 30
So, if I want it to start at run level 3 and stop at run levels 0 and 6, the commands would be this?

# /sbin/chkconfig --level 3 mysql.server on
# /sbin/chkconfig --level 0 mysql.server off
# /sbin/chkconfig --level 6 mysql.server off

I can see how your sendmail example would work because RH understands that "sendmail" is a service, but why would this work on my machine? Could you elaborate please?

Thanks,

Chris
 
Old 06-10-2003, 08:25 PM   #4
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
You can use:

chkconfig --list

to see all the available services. For mysql the daemon is mysqld so it would be:

chkconfig --level 3 mysqld on
 
Old 06-10-2003, 08:46 PM   #5
WorldBuilder
Member
 
Registered: Mar 2003
Location: Massachusetts, USA
Distribution: RH 8, Solaris, Windoze eXPunged
Posts: 520

Original Poster
Rep: Reputation: 30
Nope, sorry. That didn't work. I tried all of these:

chkconfig --level 3 /usr/sbin/mysqld on
chkconfig --level 3 /usr/sbin/mysql.server on
chkconfig --level 3 mysql.server on
chkconfig --level 3 mysqld on

None worked. I would get:

error reading information on service whatever: No such file or directory

Like I said, my executable file to start, stop, and restart is "mysql.server" and it is located in /usr/sbin. How can I automatically run that at startup?

Chris
 
Old 06-10-2003, 09:09 PM   #6
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
Does:

chkconfig --list | grep mysql

return anything?
 
Old 06-10-2003, 09:33 PM   #7
WorldBuilder
Member
 
Registered: Mar 2003
Location: Massachusetts, USA
Distribution: RH 8, Solaris, Windoze eXPunged
Posts: 520

Original Poster
Rep: Reputation: 30
No, it did not. Hmmmmmmm

Chris
 
Old 06-10-2003, 10:05 PM   #8
jstu
Member
 
Registered: Jan 2002
Distribution: slackware
Posts: 193

Rep: Reputation: 30
Check the directory /etc/init.d for a mysql startup file if you installed it with an rpm it should be there. If you instaleld it by source then mysql comes with a startup file called mysql.server or at least it used to copy that file to /etc/init.d then try the chkconfig command again.
 
Old 06-10-2003, 11:01 PM   #9
gdrobson
Member
 
Registered: Jun 2002
Location: Ontario, Canada
Distribution: RH8.0
Posts: 65

Rep: Reputation: 15
if you could always enter the start command in /etc/rc.d/rc.local
as well.

You can also create symbolic links in your respective directories.

for example in my start up dir i have S78mysqld -> ../init.d/mysqld

good luck
 
Old 06-11-2003, 09:23 AM   #10
WorldBuilder
Member
 
Registered: Mar 2003
Location: Massachusetts, USA
Distribution: RH 8, Solaris, Windoze eXPunged
Posts: 520

Original Poster
Rep: Reputation: 30
JSTU,

I installed from source and that is the startup file (mysql.server). I will try what you suggest. Thanks!

Chris
 
Old 06-11-2003, 07:05 PM   #11
KennyK
Member
 
Registered: Apr 2003
Location: California, USA
Distribution: Redhat 8.0, 9.0 Suse 9.0 Pro
Posts: 129

Rep: Reputation: 15
Or to make it simple, you could install Webmin and there is the option in there that you can have mysql to start at bootup.

Although, you wouldn't learn that much. But it will do the trick.

regards, Kenny
 
Old 06-13-2003, 11:25 AM   #12
WorldBuilder
Member
 
Registered: Mar 2003
Location: Massachusetts, USA
Distribution: RH 8, Solaris, Windoze eXPunged
Posts: 520

Original Poster
Rep: Reputation: 30
JSTU,

What you suggested did it! Thanks!

Chris
 
Old 06-14-2003, 01:45 AM   #13
jayakrishnan
Member
 
Registered: Feb 2002
Location: India
Distribution: Slacky 12.1, XP
Posts: 992

Rep: Reputation: 30
use [B]ntsysv[\B]
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian run MySQL on Startup baandar Linux - Software 3 09-02-2004 01:45 AM
hostname, modprobe, run apache + mysql on startup intense Slackware 7 03-19-2004 09:09 AM
Getting MySql to run on startup jriis Debian 8 03-16-2004 12:20 PM
Apache and MySQL servers won't run at startup! dday007 Linux - Newbie 2 02-07-2003 04:01 PM
Apache server and MySQL server won't run at startup! dday007 Linux - General 2 02-07-2003 02:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration