LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   MySQL is not starting automatically (https://www.linuxquestions.org/questions/linux-software-2/mysql-is-not-starting-automatically-485553/)

DdOs 09-21-2006 02:35 AM

MySQL is not starting automatically
 
Hi..
I am Using Slackware 10.2 with Dropline Gnome. Yesterday I installed MySQL 5.1.4-alpha on my system. Everything is ok. when i try to turn MySQL on manualy with..

/usr/local/mysql/bin/mysql_safe -user=mysql &

MySQL turns ON.. but I want to start it automatically when I start Slackware as Apache Server DOES...

Please, let me know what to do!!

Please, note.. I am not an EXPART USER.. I am Just a Beginer, so, it will be so kind of you if you reply in DETAIL...

Thank You all

odcheck 09-21-2006 02:53 AM

in redhat chkconfig mysqld on (which is the easy way...)
but in slack you'll probably have to use the old fashioned way which was creating or deleting symbolic links in the respective /etc/rcX.d/ directories. Here X in rcX.d is a number which stands for the runlevel. There can be two kinds of symbolic links in the /etc/rcX.d/ directories. One starts with the character 'S' followed by a number between 0 and 99 to denote the priority, followed by the name of the service you want to enable. The second kind of symlink has a name which starts with a 'K' followed by a number and then the name of the service you want to disable. So in any runlevel, at any given time, for each service, there should be only one symlink of the 'S' or 'K' variety but not both.
So you'll probably have to write your own script? I am not so firm with Slackware but it should look like this for e.g. /etc/rc.d/rc.M
Code:

# Start MySQL server:
if [ -x /etc/rc.d/rc.mysql ]; then
. /etc/rc.d/rc.mysql start
fi

and of course add this to /etc/rc.d/rc.K above the #Kill all processes line:
Code:

# Shut down the MySQL database server
if [ -x /etc/rc.d/rc.mysql ]; then
. /etc/rc.d/rc.mysql stop
fi

Then you'll have to create the /etc/rc.d/rc.mysql script like this
Code:

#!/bin/sh
#
# Start the MySQL database server
#

case "$1" in
'start')
/usr/local/mysql/support-files/mysql.server start ;;
'stop')
/usr/local/mysql/support-files/mysql.server stop ;;
'restart')
/usr/local/mysql/support-files/mysql.server restart ;;
*)
echo "usage $0 start|stop|restart" ;;
esac

But maybe there is a much easier way on how to do this.

DdOs 09-21-2006 04:32 AM

odcheck,

First I want to thank you for reply. Thank You Very Much...
I have tried you way.. but.. still it's not working. I can run MySQL manually.. but not automatically.. :( any other way??

Thanking You again

DdOs

filex 09-21-2006 04:37 AM

Not sure slackware have /etc/rc.local?

Just edit /etc/rc.local and putting your startup command.

zborgerd 09-21-2006 10:08 AM

Read the initialization file located here:

/etc/rc.d/rc.mysqld

And it will tell you how to make it startup on boot.

odcheck 09-21-2006 10:18 AM

@filex
Quote:

Not sure slackware have /etc/rc.local?
I don't know which Linux or Unix derivate has no rc.local ?
But I will learn if you let me know.

Aeiri 09-21-2006 10:24 AM

Slackware has all non necessary services disabled by default, not by commenting, but by having the "/etc/rc.d/rc.XXXX" file non-executable.

The simple solution is to run "chmod +x /etc/rc.d/rc.mysqld".

Also, Slackware doesn't have "/etc/rc.local", it's instead at "/etc/rc.d/rc.local".

odcheck 09-21-2006 10:38 AM

@Aeiri

confusing...?
Quote:

Also, Slackware doesn't have "/etc/rc.local", it's instead at "/etc/rc.d/rc.local".
I am happy that I never said that.
But correct sentence would be blahfassel.... located at /etc/rc.local it's in /etc/rc.d/

But I still don't know if it works now for DdOs?

DdOs 09-25-2006 04:42 AM

Quote:

Originally Posted by odcheck

would be blahfassel.... located at /etc/rc.local it's in /etc/rc.d/

But I still don't know if it works now for DdOs?

Buddy... odcheck...

in slackware I can found only /etc/rc.d ... I guess.. every program to start automatically while loading Slackware is controlled by this folder.. but.. I don't have anything like /etc/rc.d/rc.mysqld :S

Guys.. do you suggest me to re-Install slackware with appropeate options?? as you know I am a newbie.. I am not sure actually.. that which programs are appropeate for me.. :S

I have tried to copy /support-files/mysql.server to /etc/rc.d/mysql AND even tried to copy the file as rc.mysqld.. but still not working...

I found the installations process for Apache + PHP + MySql (all togather) on www.madpenguin.org. I had to do some extra work with Apache.. like i had to Delete builtin rc.httpd then copy apachectl from /usr/local/apache2 (--- newly installed apache folder) to /etc/rc.d/ as rc.httpd... then I changed mode for that file with
chmod 755 rc.httpd.. after doing all this.. apache starts automatically and the new version is working now..

I tried several ways with my LIMITED Knowledge on slackware linux to get mysql started automatically... still not working.. any more suggestion??

thank you all... very very much for helping me..

DdOs

zborgerd 09-25-2006 08:17 AM

Did you read the contents of /etc/rc.d/rc.mysqld ?

You should be using the default script that slackware installed. If you are not, then things may not work. Do not copy files around aimlessly.

If you've tainted the init script with some other bizarre file, you should reinstall it. The /etc/rc.d/rc.mysqld that is installed by default has all of the information in its first few lines that you will need to make it work.

odcheck 09-25-2006 08:54 AM

I said that I created those files.
Not that you'll find them.

DdOs 09-27-2006 12:31 AM

Quote:

Originally Posted by zborgerd
Did you read the contents of /etc/rc.d/rc.mysqld ?

You should be using the default script that slackware installed. If you are not, then things may not work. Do not copy files around aimlessly.

If you've tainted the init script with some other bizarre file, you should reinstall it. The /etc/rc.d/rc.mysqld that is installed by default has all of the information in its first few lines that you will need to make it work.

My Friend.. I already informed you all that there was no file in /etc/rc.d/ named rc.mysqld.... and I have followed a set of instruction to install mysql, apache and php... apache and php is OK and fine.. problem with mysqld only... but still I will try your suggestion... I will reinstall mysql again.. by the way.. how to UNINSTALL mysql?? can you help me?? I want to Uninstall mysql completely so that when I reinstall mysql.. no problem is there...

Thank YOU ALL

DdOs

DdOs 09-27-2006 12:35 AM

Quote:

Originally Posted by odcheck
I said that I created those files.
Not that you'll find them.


Sorry buddy.. I didn't actually mean that... I was trying answer everyon's questions with the same post.

Thank You

DdOs

zborgerd 09-27-2006 05:09 PM

Quote:

Originally Posted by DdOs
My Friend.. I already informed you all that there was no file in /etc/rc.d/ named rc.mysqld.... and I have followed a set of instruction to install mysql, apache and php... apache and php is OK and fine.. problem with mysqld only... but still I will try your suggestion... I will reinstall mysql again.. by the way.. how to UNINSTALL mysql?? can you help me?? I want to Uninstall mysql completely so that when I reinstall mysql.. no problem is there...

Thank YOU ALL

DdOs

If the /etc/rc.d/rc.mysqld init script is missing, then there is something wrong with your myqsl install.

Download the mysql package from the Slackware ftp site. The latest version is located in the /patches/ folder for 10.2.

http://slackware.osuosl.org/slackwar..._slack10.2.tgz

You can, as root, type:

"upgradepkg --reinstall mysql-4.1.21-i486-1_slack10.2.tgz".

DdOs 10-02-2006 05:28 AM

Quote:

Originally Posted by zborgerd
If the /etc/rc.d/rc.mysqld init script is missing, then there is something wrong with your myqsl install.

Download the mysql package from the Slackware ftp site. The latest version is located in the /patches/ folder for 10.2.

http://slackware.osuosl.org/slackwar..._slack10.2.tgz

You can, as root, type:

"upgradepkg --reinstall mysql-4.1.21-i486-1_slack10.2.tgz".

Thank You buddy.. I will try to reinstall first.. if Unsuccessful then I will go for latest version.. thanx a lot for your suggestion.. I defenately will let you all know what ever happens...

Thank you

DdOs


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