Operating System - HP-UX
1748121 Members
3336 Online
108758 Solutions
New Discussion юеВ

Re: mysql cannot start automatically after reboot HP-UX 11.0

 
SOLVED
Go to solution
Kenneth_61
Frequent Advisor

mysql cannot start automatically after reboot HP-UX 11.0

Hi all, I have above problem. But, mysql can start without problem when run manually. I know that the startup script should be put on /sbin/init.d . Anyone can help me ?

========================
# pwd
/sbin/init.d

# ll mysqlstart
rwxr-xr-x 1 bin bin 94 May 29 18:21 mysqlstart

# cat mysqlstart
PATH=$PATH:/usr/local/mysql/bin
export PATH
/usr/local/mysql/support-files/mysql.server start
# ./mysqlstart
Starting MySQL
... SUCCESS!
9 REPLIES 9
Steven E. Protter
Exalted Contributor

Re: mysql cannot start automatically after reboot HP-UX 11.0


Its usually an environment issue.

at the prompt:

env > /tmp/normal.mysql.env.txt

in the startup script

env > /tmp/startup.mysql.env.txt

boot the box

diff the two files.

when the environments are the same mysql will start.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Kenneth_61
Frequent Advisor

Re: mysql cannot start automatically after reboot HP-UX 11.0

Should my created file mysqlstart put into the /sbin/init.d ? I found that "env > /tmp/startup.mysql.env.txt" is not run ! The file startup.mysql.env.txt have not created after reboot.

Your suggestion is very good to do the compare. But, the "env >" cannot run after reboot. Please help.

================================
# cd /tmp
# ll *.txt
-rw-rw-rw- 1 root sys 700 May 30 06:30 normal.mysql.env.txt

========== Only one txt file after reboot ==
# pwd
/sbin/init.d
# cat mysqlstart
env > /tmp/startup.mysql.env.txt
/usr/local/mysql/support-files/mysql.server start

# ./mysqlstart
Starting MySQL
... SUCCESS!

V. Nyga
Honored Contributor
Solution

Re: mysql cannot start automatically after reboot HP-UX 11.0

Hi Kenneth,

I installed mysql yesterday, so maybe I can help you.

To start applications during boot process you have to create a link in /sbin/rcX.d.

X are different levels to start.
For mysql it should be 3.
Check your directory /sbin/rc3.d to see how it works.
Change to /sbin/rc3.d -
'ln -s /sbin/init.d/mysql.server S899mysql' for example
To stop mysql at shutdown you have to create a similar link in /sbin/rc2.d.
'ln -s /sbin/init.d/mysql.server K111mysql'

So I didn't test it yet (it's my server) it should work.

You can see all processes which start this way in /etc/rc.log.

There you should also see error messages if it doesn't work.

HTH
Volkmar
*** Say 'Thanks' with Kudos ***
Bejoy C Alias
Respected Contributor

Re: mysql cannot start automatically after reboot HP-UX 11.0

For starting up the mysql server at boot time, u need to put the original startup script in /sbin/init.d and a link to that script in ur /sbin/rc.X directory ( where X depends on when to start ur mysql server , whether in runlevel 2 or 3 ). The link name in /sbin/rc.X should start with the letter 'S' and a sequence number to specify that it is a startup script ( not a killing script 'K') . The sequence number is used to start the scripts in that runlevel in the order of their sequence numbers . In ur case u can simply make a link to ur startup script to the /sbin/rc3.d directory like
'ln -s /sbin/init.d/mysqlstart /sbin/rc3.d/S999mysql'
Be Always Joy ......
Kenneth_61
Frequent Advisor

Re: mysql cannot start automatically after reboot HP-UX 11.0

YEAH !! Very clear. mysql can auto start after reboot. Thanks.
Kenneth_61
Frequent Advisor

Re: mysql cannot start automatically after reboot HP-UX 11.0

O !!! MyGod. my mistake. Mysql can start. But, the database cannot be accessed. I have a phpBB2 database. I cannot access this after reboot. So, the mysql cannot be start properly. But, the mysql process is running. Anyone know why ? If I start manually, it is ok.

Boot up
==========================================================================

Starting the HPUX Webproxy subsystem ...................... [N/A ]
Start CDE login server .................................... [ OK ]
Usage: /sbin/rc3.d/S999mysql start|stop|restart|reload .... [ OK ]

==========================================================================
After root login:

WARNING: YOU ARE SUPERUSER !!

# ps -e | grep mysql
1619 ? 0:51 mysqld
1598 ? 0:00 mysqld_safe
#
Kenneth_61
Frequent Advisor

Re: mysql cannot start automatically after reboot HP-UX 11.0

I just copy /usr/local/mysql/support-files/mysql.server to /sbin/init.d . Then, I create the link in /sbin/rc3.d as instructed. However, mysql seems to be started , But, cannot access database. Anyone help ?
Kenneth_61
Frequent Advisor

Re: mysql cannot start automatically after reboot HP-UX 11.0

Moreover, if I use this auto start method for bootup, mysql cannot be stopped. Error come out.

# ./mysql.server stop
Shutting down MySQL
................................... ERROR!

So, I delete the S999mysql link. Then, reboot, manual start by ./usr/local/mysql/support-files/mysql.server start

then, it is ok. I hope to know why . :-(
doufu3344
Visitor

Re: mysql cannot start automatically after reboot HP-UX 11.0

The reason for showing

Usage: /sbin/rc3.d/S999mysql start|stop|restart|reload .... [ OK ]

is the mysql.server  does not support start_msg/stop_msg, you can add 'start_msg'/stop_msg in the file. 

detail info by rc manpage.