- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Start Mysql on system boot from a non-standard dir...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2012 04:58 AM - edited 02-02-2012 05:13 AM
02-02-2012 04:58 AM - edited 02-02-2012 05:13 AM
Start Mysql on system boot from a non-standard directory
I've set up a mysql server on HP-UX for a client, however the client wanted mysql to be installed in /mysq instead in the default directory /usr/local/mysql.
Everything is running fine, except that little fact that I need to set the daemon to start on server boot time. There is a very little explanation in the /mysql/support-files/mysql.server file since this file has been created as a general guideline for all UNIX/LINUX systems.
When the server boots up there is a list of processes that are starting with it:
Start MySQL Server .................................................. OK
However when i try:
# ps -ef
to see a list of proccesses running on the system, mysql isn't there...
So I have to start the daemon and the server manualy:
# cd /mysql
# ./bin/safe_mysqld --user=root & [1] 3847 # Starting mysqld daemon with databases from /mysql/data # # ./support-files/mysql.server start Starting MySQL SUCCESS! # # ps -ef | grep -i mysql root 3847 1965 0 13:25:06 pts/0 0:00 /bin/sh ./bin/safe_mysqld --user=root root 3867 3847 0 13:25:06 pts/0 0:00 /mysql/bin/mysqld --basedir=/mysql --datadir=/mysql/data --u root 3961 1965 0 13:26:40 pts/0 0:00 grep -i mysql # #
Does anyone know how can I force the mysql daemon and the mysql server to start when the system boots up?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2012 07:16 AM
02-02-2012 07:16 AM
Re: Start Mysql on system boot from a non-standard directory
Check the script in /sbin/init.d that starts MySQL. Look there for any paths that may be set to point to /usr/local/mysql and point them to /mysql.
The other option is to link /usr/local/mysql to /mysql and see if that will work.
# cd /usr/local
# ln -s /mysql .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2012 03:12 AM - edited 02-07-2012 03:14 AM
02-07-2012 03:12 AM - edited 02-07-2012 03:14 AM
Re: Start Mysql on system boot from a non-standard directory
Already checked in /sbin/init.d there is a script mysql.server where I put the parametars folowing the instructions in the same file:
basedir=/mysql datadir=/mysql/data
Also in /etc/my.cnf I updated the mysqld location:
[mysqld] basedir=/mysql
And still when the server starts is is giving info that it starts the mysqldaemon but on when i try
ps -ef | grep -i mysql the mysql processes are not listed.
I am thinking diferently now.. is there a way to create some sort of a startup script to execute the folowing comands on startup:
# cd /mysql # ./bin/safe_mysqld --user=root & # ./support-files/mysql.server start
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2012 03:29 AM
02-07-2012 03:29 AM
Re: Start Mysql on system boot from a non-standard directory
>is there a way to create some sort of a startup script to execute the following commands on startup:
Just edit mysql.server and put it there?
Is there a symlink in one of the /sbin/rc#.d/ directories to mysql.server?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2012 04:31 AM - edited 02-07-2012 05:35 AM
02-07-2012 04:31 AM - edited 02-07-2012 05:35 AM
Re: Start Mysql on system boot from a non-standard directory
There are four lc#.d directories located in /sbin/. Here's the output when searching for links to mysql.server.
# ls -l /sbin/rc0.d | grep -i mysql # ls -l /sbin/rc1.d | grep -i mysql # ls -l /sbin/rc2.d | grep -i mysql lrwxrwxrwx 1 root sys 25 Jul 28 14:11 K700mysql.server -> /sbin/init.d/mysql.server # ls -l /sbin/rc3.d | grep -i mysql lrwxrwxrwx 1 root sys 25 Jul 28 14:11 S700mysql.server -> /sbin/init.d/mysql.server # ls -l /sbin/rc4.d | grep -i mysql
And as i said I've configured mysql.server file according to the instructions inside it.
# If you install MySQL on some other places than /usr/local/mysql, then you # have to do one of the following things for this script to work: # # - Run this script from within the MySQL installation directory # - Create a /etc/my.cnf file with the following information: # [mysqld] # basedir=<path-to-mysql-installation-directory> # - Add the above to any other configuration file (for example ~/.my.ini) # and copy my_print_defaults to /usr/bin # - Add the path to the mysql-installation-directory to the basedir variable # below. # # If you want to affect other MySQL variables, you should make your changes # in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files. # If you change base dir, you must also change datadir. These may get # overwritten by settings in the MySQL configuration files. basedir=/mysql datadir=/mysql/data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2012 07:29 AM
02-07-2012 07:29 AM
Re: Start Mysql on system boot from a non-standard directory
Start MySQL Server .................................................. OK
This only means the script was invoked and did not return an error code. You should look at /etc/rc.log to see if any error messages were produced by mysql and/or the mysql.server script.