Installation of MySQL Database server on Solaris is not that difficult but is a bit dragging and not as straightforward as is in any other Linux flavors. The following procedure will help install MySQL and configure successfuly in Sun Solaris.
To install MySQL Database server on Solaris follow the procedures listed below:
Note: I've used MySQL-5.0.24a for Solaris 8. However, this is a very generic
procedure and I'm sure will work on other Solaris versions.
Download the MySQL Package for solaris from
Once downloaded unzip using
# gzip mysql-standard-5.0.24a-solaris8-sparc-64bit.tar.gz
Now, comes the first problem, you need to have GNU Tar installed on your Solaris server as there is bug in getting the classic Solaris one to work.
To download and install GNUTar, please click here.
Untar using GNUTar by
# tar -xvf mysql-standard-5.0.24a-solaris8-sparc-64bit.tar
Now, install using
# pkgadd -d mysql-standard-5.0.24a-solaris8-sparc-64bit.pkg
This installs the software. You can be confirmed using
# pkginfo -l mysql
This will give a detailed output describing the installation.
Now, change dir to /opt/mysql/mysql/support-files
# cd /opt/mysql/mysql/support-files
Copy the my-middle.cnf as my.cnf and mysql.server to /opt/mysql/mysql/scripts
# cp my-middle.cnf ../scripts/my.cnf
# cp mysql.server ../scripts/
Now, change to /opt/mysql/mysql/scripts folder
# cd opt/mysql/mysql/scripts
Edit file my.cnf using vi
Add the following lines to the file under [mysqld]
Similary, edit the mysql.server file and add the following lines:
# vi mysql.server
Now, all done, run the mysql_install_db script as follows
# ./mysql_install_db –defaults-file=/opt/mysql/mysql/scripts/my.cnf
This creates the initial MySQL database.
Now, start MySQL using
cd . ; /opt/mysql/mysql/bin/mysqld_safe &
This will start MySQL.
Now, you need to set the password for root account
# /opt/mysql/mysql/bin/mysqladmin -u root password ‘newpassword’
# /opt/mysql/mysql/bin/mysqladmin -u root -h <hostname> password ‘newpassword’
This completes a successful installation of MySQL on your Solaris Server.
1 thought on “How to install MySQL database server in Sun Solaris”
# vi mysql.server
is that suppose to be
I cant get it to create the database for mysql I just might tar and take the one out of my linux system