You are not logged in.

#1 2008-08-13 04:32:55

vertimyst
Member
From: Canada
Registered: 2008-05-28
Posts: 71
Website

How to start MySQL on boot?

Hi,

I'm setting up a temporary server on my laptop, and I want to start MySQL on boot.   I'm reading a book on PHP, and it gives instructions for installing MySQL.   Normally I would just use pacman, but this book seems to want me to do the setup its way (and I want to do it manually for a change).

It says to use these commands to autostart MySQL:

cp /usr/local/mysql/support-files/mysql.server /etc/init.d/
cd /etc/rc2.d
ln -s ../init.d/mysql.server S99mysql
cd /etc/rc3.d
ln -s ../init.d/mysql.server S99mysql
cd /etc/rc5.d
ln -s ../init.d/mysql.server S99mysql
cd /etc/rc0.d
ln -s ../init.d/mysql.server K01mysql

However, this obviously won't work since Arch uses BSD's init system, right?   I'm not familar with this, so how would I go about doing the above within Arch?   I've searched the forum, and the wiki, and couldn't find anything.

Last edited by vertimyst (2008-08-13 04:34:10)


-Vert wink
---------
Free webhosting@http://shadowserve.ath.cx - Currently and soon to go through many changes, still alive! - June 29, 2009

Offline

#2 2008-08-13 05:49:38

zyghom
Member
From: Poland/currently Africa
Registered: 2006-05-11
Posts: 432
Website

Re: How to start MySQL on boot?

what about putting this service in /etc/rc.conf in section: DAEMONS ?


Zygfryd Homonto

Offline

#3 2008-08-13 14:42:43

vertimyst
Member
From: Canada
Registered: 2008-05-28
Posts: 71
Website

Re: How to start MySQL on boot?

Well, I'm not sure what to put in that section.   Would I put mysql.server?   I don't think putting mysqld would do anything, since I didn't install it via pacman (just downloaded MySQL from the official site and untarred it).

Edit: This is odd, I got an email saying wonder replied, but clicking the link in the email tells me 'Bad request. The link you followed is incorrect or outdated', and there's no post.   Hmm.

Last edited by vertimyst (2008-08-13 15:31:08)


-Vert wink
---------
Free webhosting@http://shadowserve.ath.cx - Currently and soon to go through many changes, still alive! - June 29, 2009

Offline

#4 2008-08-13 16:42:50

marxav
Member
From: Gatineau, PQ, Canada
Registered: 2006-09-24
Posts: 386

Re: How to start MySQL on boot?

Look no further that the wiki http://wiki.archlinux.org/index.php/MySQL#Configuration

To start MySQL at bootup add mysqld to the list of daemons in /etc/rc.conf

Offline

#5 2008-08-13 16:45:40

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: How to start MySQL on boot?

is not odd. i deleted my post. i can't understand why you don't want to install mysql with pacman. i don't think that is a difference between manual setup and mysql from extra(maybe version)

Last edited by wonder (2008-08-13 16:47:56)


Give what you have. To someone, it may be better than you dare to think.

Offline

#6 2008-08-13 18:14:41

ssjlegendx
Member
Registered: 2008-01-01
Posts: 94
Website

Re: How to start MySQL on boot?

vertimyst wrote:

It says to use these commands to autostart MySQL:

cp /usr/local/mysql/support-files/mysql.server /etc/init.d/
cd /etc/rc2.d
ln -s ../init.d/mysql.server S99mysql
cd /etc/rc3.d
ln -s ../init.d/mysql.server S99mysql
cd /etc/rc5.d
ln -s ../init.d/mysql.server S99mysql
cd /etc/rc0.d
ln -s ../init.d/mysql.server K01mysql

I'm not sure how "correct" this is, but -- if that code snippet is accurate for the System V init system -- I think you could just add the following to /etc/rc.local:

/usr/local/mysql/support-files/mysql.server start

Then, to make sure that the server is stopped at shutdown, you could add this to /etc/rc.local.shutdown:

/usr/local/mysql/support-files/mysql.server stop

Another (perhaps dirtier) solution would be to issue

ln -s /usr/local/mysql/support-files/mysql.server /etc/rc.d/mysqld

and then add mysqld to the DAEMONS array in /etc/rc.conf. (Do NOT do this if you also have MySQL installed via Pacman, as it will overwrite the preexisting daemon startup script.)


Also, after you get MySQL working the "manual" way, you might want to look into writing a PKGBUILD for it. Then, you could delete the manually-installed files and re-install with Pacman, providing cleaner management and giving you some experience working with the packaging system. smile


#!/vim/rocks

Offline

#7 2008-08-13 20:02:51

vertimyst
Member
From: Canada
Registered: 2008-05-28
Posts: 71
Website

Re: How to start MySQL on boot?

wonder wrote:

is not odd. i deleted my post. i can't understand why you don't want to install mysql with pacman. i don't think that is a difference between manual setup and mysql from extra(maybe version)

Because the book requires I configure Apache, MySQL, and PHP with certain options (i.e, ./configure --module-so, or ./configure --with-apxs2=/path/to/apxs).   AFAIK, I can't do this if I install with pacman.

marxav wrote:

Look no further that the wiki http://wiki.archlinux.org/index.php/MySQL#Configuration

To start MySQL at bootup add mysqld to the list of daemons in /etc/rc.conf

marxav, that would only work if I had installed MySQL via pacman.

I'll try what you suggest, ssjlegendx, if that doesn't work I guess I'll go with pacman and do my best to follow along with the book.

Just to clear confusion - I normally run Ubuntu server edition on my server box, which automatically installs LAMP.   I'm setting up a temporary server on my laptop running Arch, but following this book exactly so I ensure nothing will go wrong.   If it were not for this book, I would have gladly used pacman.


-Vert wink
---------
Free webhosting@http://shadowserve.ath.cx - Currently and soon to go through many changes, still alive! - June 29, 2009

Offline

#8 2008-08-13 20:27:15

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: How to start MySQL on boot?

did you ever bother to try apache,php and mysql from arch and see if it fit the book demands?


Give what you have. To someone, it may be better than you dare to think.

Offline

#9 2008-08-13 20:52:45

vertimyst
Member
From: Canada
Registered: 2008-05-28
Posts: 71
Website

Re: How to start MySQL on boot?

No, and I'm not sure how I would tell, either, aside from possibly stumbling across a problem later on, or not.   I will try to install them via pacman as well, just following the book's instructions for now.


-Vert wink
---------
Free webhosting@http://shadowserve.ath.cx - Currently and soon to go through many changes, still alive! - June 29, 2009

Offline

#10 2008-08-13 20:58:05

ghostHack
Member
From: Bristol UK
Registered: 2008-02-29
Posts: 261

Re: How to start MySQL on boot?

vertimyst wrote:

No, and I'm not sure how I would tell, either, aside from possibly stumbling across a problem later on, or not.

Use ABS to grab the PKGBUILDs gor mysql and apache, then compare the configure options used in the PKGBUILD with what the book is asking for (you may also want to run configure --help to see what the defaults are)

Offline

#11 2008-08-14 02:34:20

marxav
Member
From: Gatineau, PQ, Canada
Registered: 2006-09-24
Posts: 386

Re: How to start MySQL on boot?

vertimyst wrote:

No, and I'm not sure how I would tell, either, aside from possibly stumbling across a problem later on, or not.   I will try to install them via pacman as well, just following the book's instructions for now.

Do you mind sharing the book title.  Maybe one of us has it...

Offline

#12 2008-08-14 02:41:49

vertimyst
Member
From: Canada
Registered: 2008-05-28
Posts: 71
Website

Re: How to start MySQL on boot?

Build Your Own Database Driven Website Using PHP & MySQL, by Kevin Yank, 3rd Edition.

Anyway, I have it starting now, and everything seems to be working fine.   However, my sites are loading slowly, particularly images, when accessed via the domain names or my external IP.   Accessing locally, it's fine.   I've started a new thread to address this problem.

Last edited by vertimyst (2008-08-15 17:55:13)


-Vert wink
---------
Free webhosting@http://shadowserve.ath.cx - Currently and soon to go through many changes, still alive! - June 29, 2009

Offline

Board footer

Powered by FluxBB