LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices

Reply
 
Search this Thread
Old 07-07-2007, 12:49 AM   #1
Han_Nguyen
LQ Newbie
 
Registered: Jul 2007
Posts: 6

Rep: Reputation: 0
How to add mysqld_safe --user=mysql & in /etc/rc.d/rc.local


Hi all,

I just started to learn about Linux and first time try to install mysql on my Mandrake machine. Could someone please show me what is the syntax to add ../bin/mysqld_safe --user=mysql & into my system start up script rc.local so mysql will start every time when my computer boot up. Any help would be greatly appreciated.
 
Old 07-07-2007, 05:50 PM   #2
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
Hi and welcome to LQ. If you compiled mysql from source, then the right way to do it is to copy a file called mysql.server (from the mysql source tarball or your mysql installation) to /etc/init.d, rename it to mysql and then do
Code:
#chkconfig --add mysql
#chkconfig mysql on
If you installed mysql from your distributions packages, then all you need to do is
Code:
#chkconfig mysql on
In both cases mysql will start automatically each time you boot your machine.

Last edited by reddazz; 07-07-2007 at 05:52 PM.
 
Old 07-08-2007, 02:51 PM   #3
Han_Nguyen
LQ Newbie
 
Registered: Jul 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Reddazz,

Thank you for your response to my post. I am installing mysql from source. I have not able to find mysql.server from the source tarball directory or /usr/local/bin. I am installing mysql-5.0.22, could mysql.server file be located somewhere else?

Thanks again,
 
Old 07-09-2007, 04:39 PM   #4
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
Sorry for the late reply. In the mysql 5.x tarball, there is a folder called support-files, copy mysql.server.sh to /etc/init.d and rename it to mysql.
 
Old 07-10-2007, 01:04 AM   #5
Han_Nguyen
LQ Newbie
 
Registered: Jul 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Reddazz,

I have copied the file over and did the chkconfig commands. I got 4-5 responses "Warning: netfs is needed by mysql in runlevel 2" each time. Could you advice what does it mean. I am seeing a netfs file in the same directory. Thanks again for your help.
 
Old 07-10-2007, 01:15 AM   #6
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
I've been looking at the Mandriva developer site and it seems like that error happens when you have not added the mysql user and group to the system. Also maybe you need to enable netfs which you can do using "chkconfig netfs on".
 
Old 07-10-2007, 09:47 PM   #7
Han_Nguyen
LQ Newbie
 
Registered: Jul 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Reddazz,

After do the chkconfig netfs on, I don't get those messages anymore. However, mysql still is not start up automatically when the machine boot up. I still have to start it manually. You mentioned about add user and group to system, how can I do that. Again, many thanks for your help.
 
Old 07-11-2007, 04:19 AM   #8
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
You use the useradd and groupadd commands. If mysql starts manually, then the problem does not seem to be related to groups. What is the output of doing
Code:
#chkconfig --list | grep -i mysql
 
Old 07-14-2007, 01:09 AM   #9
Han_Nguyen
LQ Newbie
 
Registered: Jul 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Redazz,

Sorry, I was out the last couple of days. This is the result when I execute the command:

[root@localhost tmp]# chkconfig --list | grep -i mysql
mysql 0ff 1ff 2n 3n 4n 5n 6ff
[root@localhost tmp]#


Please help
 
Old 07-14-2007, 03:42 AM   #10
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
From the results, it seems like it is set to startup at boot time. What happens when you do
Code:
#service mysql start
Another option is to add the commands to start mysql in /etc/rc.d/rc.local.
 
Old 07-16-2007, 12:15 AM   #11
Han_Nguyen
LQ Newbie
 
Registered: Jul 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Reddazz,

Here is the results bounced back when I type in that command:

[root@localhost mysql]# service mysql start
/etc/init.d/mysql: line 220: my_print_defaults: command not found
/etc/init.d/mysql: line 223: my_print_defaults: command not found
/etc/init.d/mysql: line 230: @HOSTNAME@: command not found
/etc/init.d/mysql: line 239: @HOSTNAME@: command not found
/etc/init.d/mysql: line 248: cd: @prefix@: No such file or directory
[root@localhost mysql]#


BTW, what is the syntax to add start mysql in /etc/rc.d/rc.local?


Many many thanks!
 
Old 07-16-2007, 07:40 PM   #12
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
Try adding /usr/local/mysql/bin or whatever directory contains your mysql binaries to your PATH.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
mySQL - local user privileges Genjix Programming 2 12-03-2004 09:03 AM
Fail to add a local user in a computer working with NIS pwangee Fedora 2 07-07-2004 10:28 PM
Fail to add a local user in a computer working with NIS pwangee Linux - Networking 0 07-07-2004 11:01 AM
how do i add a local user that can use x window? hedich Linux - General 2 07-05-2003 08:41 AM
mysqld_safe & jakublgz Linux - General 1 02-21-2003 08:02 AM


All times are GMT -5. The time now is 04:48 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration