Skip to content. | Skip to navigation

Navigation

Personal tools

Development Applications

Perl, CVS, Databases, that sort of stuff

MySQL

Sun supply an instance of MySQL in /usr/sfw however it's a touch elderly. MySQL recommend you use their binary downloads! In this instance, the Sol 10 pkg for 5.0.15.

su
groupadd mysql
useradd -g mysql mysql
passwd -l mysql
pkgadd -d .../mysql-standard-5.0.15-solaris10-i386.pkg

A little post-install work:

# the cd should take you to /usr/local/mysql/mysql-standard-5.0.15-solaris10-i386
cd /usr/local/mysql/!$:t:r
./scripts/mysql_install_db --user=mysql
chown -R root  .
chown -R mysql data
chgrp -R mysql .

cat <<EOF > /etc/init.d/mysql
#!/bin/sh

MYSQL_TOP=${PWD}

(
 cd \${MYSQL_TOP}
 ./support-files/mysql.server \$1
)
EOF
chmod a+x /etc/init.d/mysql
ln /etc/init.d/mysql /etc/rc3.d/S50mysql
ln /etc/init.d/mysql /etc/rc3.d/K50mysql

Twirl with the MySQL configuration file (noting that basedir will be set to something like /usr/local/mysql/mysql-standard-5.0.15-solaris10-i386) and watch out for the embedded newlines in this sed script:

# set up my.cnf file or edit the existing one!
sed -e '/^.mysqld.$/a\
basedir         = '$PWD'
' support-files/my-medium.cnf > /etc/my.cnf

Finally create root password entries (root as in admin user).

Note

We create passwords for the user for both localhost and our hostname ($(uname -n)) as it's never terribly clear when applications decide to use which.

./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h $(uname -n) 'new-password'

Document Actions