Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
07-06-2007, 11:49 PM
|
#1
|
LQ Newbie
Registered: Jul 2007
Posts: 6
Rep:
|
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.
|
|
|
07-07-2007, 04:50 PM
|
#2
|
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
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 04:52 PM.
|
|
|
07-08-2007, 01:51 PM
|
#3
|
LQ Newbie
Registered: Jul 2007
Posts: 6
Original Poster
Rep:
|
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,
|
|
|
07-09-2007, 03:39 PM
|
#4
|
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
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.
|
|
|
07-10-2007, 12:04 AM
|
#5
|
LQ Newbie
Registered: Jul 2007
Posts: 6
Original Poster
Rep:
|
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.
|
|
|
07-10-2007, 12:15 AM
|
#6
|
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
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".
|
|
|
07-10-2007, 08:47 PM
|
#7
|
LQ Newbie
Registered: Jul 2007
Posts: 6
Original Poster
Rep:
|
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.
|
|
|
07-11-2007, 03:19 AM
|
#8
|
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
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
|
|
|
07-14-2007, 12:09 AM
|
#9
|
LQ Newbie
Registered: Jul 2007
Posts: 6
Original Poster
Rep:
|
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 0 ff 1 ff 2 n 3 n 4 n 5 n 6 ff
[root@localhost tmp]#
Please help
|
|
|
07-14-2007, 02:42 AM
|
#10
|
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
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.
|
|
|
07-15-2007, 11:15 PM
|
#11
|
LQ Newbie
Registered: Jul 2007
Posts: 6
Original Poster
Rep:
|
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!
|
|
|
07-16-2007, 06:40 PM
|
#12
|
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
Try adding /usr/local/mysql/bin or whatever directory contains your mysql binaries to your PATH.
|
|
|
All times are GMT -5. The time now is 10:37 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|