Getting OpenCSW distro of mysql5 running on Solaris



To get mysql running on a Sun Solaris box with the OpenCSW package:

To find out what the status is:
# /usr/bin/svcs -x cswmysql5
svc:/network/cswmysql5:default (?)
 State: maintenance since Fri Dec 30 13:04:02 2011
Reason: Method failed repeatedly.
   See: http://sun.com/msg/SMF-8000-8Q
   See: /var/svc/log/network-cswmysql5:default.log
Impact: This service is not running.


Read the log file.
To see how it starts up, read /var/opt/csw/svc/method/svc-cswmysql5. You have to copy one of the my-*.cnf files into $sysconfdir.

If it won't start, read /var/opt/csw/mysql5/X.err

In my case, this file said:
111230 13:04:01 mysqld started
111230 13:04:01 [ERROR] Can't find messagefile '/opt/csw/mysql5/share/mysql/5.0/mysql/english/errmsg.sys'
111230 13:04:01 [ERROR] Aborting
111230 13:04:01 mysqld ended

In the startup script, /etc/opt/csw/init.d, we see
# 2006-03-11
    # This script no longer creates the default database. You may create the
    # default database manually or use
    # /opt/csw/mysql5/share/mysql/quick_start-csw
    #    if [ ! -d "$BASEDIR/var/mysql" ] ; then
    #        echo MySQL core database has not been created.
    #         echo Creating it now...
    #       $BASEDIR/bin/mysql_install_db
    #       chown -R mysql:mysql $BASEDIR/var
    #    fi
  # chown -R mysql:mysql $BASEDIR/var
  # fi

Except the correct path is actually
/opt/csw/share/mysql/5.0/mysql/quick_start-csw

So we have to run this script first to create /opt/csw/mysql5 and the initial database.  It failed until I create /etc/opt/csw/mysql5.  Then:
Accept the default or enter a pathname [?,q] /opt/csw/share/mysql/5.0/mysql/my-large.cnf
Using /opt/csw/share/mysql/5.0/mysql/my-large.cnf to create the options file.
data directory is /var/opt/csw/mysql5

Continue with installation or quit [y,n,?,q]
Setting up the database
Creating MySQL core database in /var/opt/csw/mysql5

###  The following messages are from mysql_install_db.
/opt/csw/share/mysql/5.0/mysql/quick_start-csw[108]: /opt/csw/mysql5/bin/mysql_install_db:  not found

###  The following messages are from quick_start-csw.
See /opt/csw/mysql5/share/mysql/doc/README.CSW for packaging changes.
Please ignore references to starting mysqld_safe in the messages above.
  These messages are from mysql_install_db.  See the following
  for starting CSWmysql5.
To start mysqld; run `svcadm enable cswmysql5` on Solaris 10 or later

But that wasn't all!  I still had to copy one of the my-.cnf files by hand to /etc/opt/csw/mysql5.

Finally, The Children of Israel arrive at the Promissed Land: # svcadm -v enable cswmysql5
svc:/network/cswmysql5:default enabled.

Comments

Popular Posts