LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-01-2004, 12:13 AM   #1
baandar
LQ Newbie
 
Registered: Aug 2004
Location: Los Angeles
Posts: 4

Rep: Reputation: 0
Debian run MySQL on Startup


Hi, this seems to be a common problem without a common answer: how do I get mysql to run automatically on startup on Debian? I think I have to start mysqld, so I have tried adding a link to this in etc/rc2.d/ called S20myql. However, that is apparently not working.

They only way I can start MySQL is to log in with SSH and run mysqld (which freezes the computer), close SSH, and login again, then it is running. Thanks very much.
 
Old 09-01-2004, 04:19 AM   #2
linux_terror
Member
 
Registered: Aug 2004
Location: Northbrook, Illinois
Distribution: CentOS-5
Posts: 311

Rep: Reputation: 30
are you running in runlevel 2?

Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)

most systems boot to 3 or 5 although i am not that familiar with debian....

If you arent then you need to put your init-script in /etc/rc3.d/ or /etc/rc5.d/

As for ssh locking up, mysql probably is running in daemon mode so you would need to tell it to fork into the background to get your command line back on a manual start. I can't remember exactly but I "think" this is achieved with a && at the end of the line...somebody please correct me if im wrong...

hope this helps.

linux_terror
 
Old 09-01-2004, 06:47 PM   #3
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Re: Debian run MySQL on Startup

Quote:
Originally posted by baandar
Hi, this seems to be a common problem without a common answer: how do I get mysql to run automatically on startup on Debian? I think I have to start mysqld, so I have tried adding a link to this in etc/rc2.d/ called S20myql. However, that is apparently not working.

They only way I can start MySQL is to log in with SSH and run mysqld (which freezes the computer), close SSH, and login again, then it is running. Thanks very much.
If it is a common problem I have never seen it here. How did you install MYSQL anyways? You should not have to be setting up any links that is already taken care of in the installation and configuration of the packages.

Code:
[HappyTux:/home/stephen]# ll /etc/rc2.d/
total 0
lrwxrwxrwx  1 root root 17 2004-03-30 22:40 K11anacron -> ../init.d/anacron
lrwxrwxrwx  1 root root 18 2004-03-30 22:40 S10sysklogd -> ../init.d/sysklogd
lrwxrwxrwx  1 root root 15 2004-03-30 22:40 S11klogd -> ../init.d/klogd
lrwxrwxrwx  1 root root 22 2004-03-30 22:40 S19spamassassin -> ../init.d/spamassassin
lrwxrwxrwx  1 root root 14 2004-06-24 22:25 S20alsa -> ../init.d/alsa
lrwxrwxrwx  1 root root 14 2004-03-30 22:40 S20apmd -> ../init.d/apmd
lrwxrwxrwx  1 root root 16 2004-03-30 22:40 S20autofs -> ../init.d/autofs
lrwxrwxrwx  1 root root 16 2004-03-30 22:40 S20cupsys -> ../init.d/cupsys
lrwxrwxrwx  1 root root 15 2004-03-30 22:40 S20dictd -> ../init.d/dictd
lrwxrwxrwx  1 root root 14 2004-03-30 22:40 S20exim -> ../init.d/exim
lrwxrwxrwx  1 root root 17 2004-03-30 22:40 S20hddtemp -> ../init.d/hddtemp
lrwxrwxrwx  1 root root 15 2004-03-30 22:40 S20inetd -> ../init.d/inetd
lrwxrwxrwx  1 root root 13 2004-03-30 22:40 S20lpd -> ../init.d/lpd
lrwxrwxrwx  1 root root 17 2004-03-30 22:40 S20makedev -> ../init.d/makedev
lrwxrwxrwx  1 root root 15 2004-07-21 02:29 S20mysql -> ../init.d/mysql
lrwxrwxrwx  1 root root 23 2004-03-30 22:40 S20smartmontools -> ../init.d/smartmontools
lrwxrwxrwx  1 root root 13 2004-03-30 22:40 S20ssh -> ../init.d/ssh
lrwxrwxrwx  1 root root 13 2004-03-30 22:40 S20xfs -> ../init.d/xfs
lrwxrwxrwx  1 root root 17 2004-03-30 22:40 S89anacron -> ../init.d/anacron
lrwxrwxrwx  1 root root 13 2004-03-30 22:40 S89atd -> ../init.d/atd
lrwxrwxrwx  1 root root 14 2004-03-30 22:40 S89cron -> ../init.d/cron
lrwxrwxrwx  1 root root 16 2004-06-12 23:03 S91apache -> ../init.d/apache
lrwxrwxrwx  1 root root 13 2004-03-30 22:40 S99kdm -> ../init.d/kdm
lrwxrwxrwx  1 root root 19 2004-03-30 22:40 S99rmnologin -> ../init.d/rmnologin
lrwxrwxrwx  1 root root 23 2004-03-30 22:40 S99stop-bootlogd -> ../init.d/stop-bootlogd
It looks like you are trying creating the correct link you may want to use either update-rc.d mysql defaults or ln -sf /etc/init.d/mysql /etc/rc2.d/S20mysql.
 
Old 09-02-2004, 01:45 AM   #4
baandar
LQ Newbie
 
Registered: Aug 2004
Location: Los Angeles
Posts: 4

Original Poster
Rep: Reputation: 0
Hi again,
Thanks to you both for you help, level 2 is my default run level. Installing with apt-get I had the option for auto load on boot, but wanting to learn more about linux and being slightly foolish I disabled this option. Will try suggested commands an post again tomorrow.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
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
I want MySQL to run at startup WorldBuilder Linux - General 12 06-14-2003 01:45 AM
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 - Software

All times are GMT -5. The time now is 04:12 PM.

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