LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   mysql daemon won't start on boot (https://www.linuxquestions.org/questions/slackware-14/mysql-daemon-wont-start-on-boot-694532/)

Foress_89 01-02-2009 12:52 PM

mysql daemon won't start on boot
 
The last message I get when I boot my computer is this
Code:

Hangover login: STOPPING server from pid file /var/run/mysql/mysql.pid 090102 13:25:54 mysqld ended
I actually have to press any key on keyboard to get to the login message. I just installed the full 12.2 dvd and selected mysqld to start on boot. I'd like to fix it, but just so I know how would I just stop it from trying to start?

astrogeek 01-02-2009 12:57 PM

Quote:

Originally Posted by Foress_89 (Post 3394829)
just so I know how would I just stop it from trying to start?

Remove execute permission form /etc/rc.d/rc.mysqld.

Didier Spaier 01-02-2009 01:00 PM

chmod -x /etc/rc.d/rc.mysqld

typed as root will prevent mysql to start at boot.

Foress_89 01-02-2009 01:11 PM

Quote:

Originally Posted by Didier Spaier (Post 3394841)
chmod -x /etc/rc.d/rc.mysqld

typed as root will prevent mysql to start at boot.

Ok ok i understand that +x gives permission -x removes... but now is it trying to start it and telling it it can't? Anyway it removes the error, but what if I want to use mysql?

astrogeek 01-02-2009 01:21 PM

Quote:

Originally Posted by Foress_89 (Post 3394854)
but what if I want to use mysql?

Simply restore the execute permission. This is actually the main mechanism used by Slackware to control init processes, BSD style.

If you decide to use mysql you will also need to initialize the database and create a user for it so you will not get the startup failures as in your first post. See the distribution docs, very easy, or just post back here and we will point you to it.

Didier Spaier 01-02-2009 01:21 PM

As root:
sh /etc/rc.d/rc.mysqld start

The file don't need to be executable for that.

When you are done, don't forget to type:
sh /etc/rc.d/rc.mysqld stop

as the MySQL daemon won't be automatically stopped when you shutdown or reboot your system, if the file is not executable.

apolinsky 01-02-2009 01:39 PM

I'm afraid the above answers are a bit wrong. By default Slackware does not create the initial tables needed to start mysql. If you read the contents of the rc.mysqld script, they will tell you what has to be done to create the initial tables.

astrogeek 01-02-2009 02:41 PM

Quote:

Originally Posted by apolinsky (Post 3394883)
I'm afraid the above answers are a bit wrong. By default Slackware does not create the initial tables needed to start mysql. If you read the contents of the rc.mysqld script, they will tell you what has to be done to create the initial tables.

Well, no... I think if you follow the thread the questions asked were answered, and we pointed out...

Quote:

If you decide to use mysql you will also need to initialize the database and create a user for it so you will not get the startup failures as in your first post. See the distribution docs, very easy, or just post back here and we will point you to it.
... so what is wrong?

Foress_89 01-02-2009 08:54 PM

Ok so it's just that mysql isn't properly configured to run right now, that all I needed to know, I'll try to find out what I have to do... But I didn't know mysql needed some tables to run, in what database? Anyway I'll search but if you have an awnser don't hesitate.

Thanks.

Foress_89 01-02-2009 09:33 PM

got it. Thanks guys.

astrogeek 01-02-2009 09:45 PM

Quote:

Originally Posted by Foress_89 (Post 3395224)
Ok so it's just that mysql isn't properly configured to run right now...

Yes, Slackware has everything installed, but you still need to initialize it. That is very easy. The main documentation to get you going is in /etc/rc.d/rc.mysqld itself...

Code:

# Before you can run MySQL, you must have a database.  To install an initial
# database, do this as root:
#
#  mysql_install_db --user=mysql
#
# Note that the mysql user must exist in /etc/passwd, and the created files
# will be owned by this dedicated user.  This is important, or else mysql
# (which runs as user "mysql") will not be able to write to the database
# later (this can be fixed with 'chown -R mysql.mysql /var/lib/mysql').

The mysql user should exist, but if not you can create it with...

useradd -s /bin/false -c 'system user for mysql 5' mysql

If you want to know more see /usr/doc/mysql-5.0.51b/Docs/INSTALL-BINARY (this from SW 12.1, adjust for 12.1). That is from the mysql distribution itself, but it will tell you what is actually happening with the mysql_install_db script.

After you have run mysql_install_db you can start and stop mysql server with...

/etc/rc.d/rc.mysqld start
/etc/rc.d/rc.mysqld stop

...and set it to be executable to automatically start at boot.

Good luck!

[EDIT]You beat me to it! Glad you got it working![/EDIT]

Foress_89 01-03-2009 09:14 AM

Yeah I actually ran just mysql_install_db then it wasn't working I had to chown in to the mysql user to make it work.. but now it does. Thanks for your help and your links are very useful.

astrogeek 01-03-2009 12:53 PM

Excellent!

Glad you got it going and thanks for letting us know - enjoy!


All times are GMT -5. The time now is 07:48 PM.