// you're reading...

Installing MySQL 5.0 on Solaris 10

This article was posted back in August 2006 in one of my first blog found on instmysql5sol10.blogspot.com. I had just shifted it here to consolidate all tutorials that I have written so far. Hopefully, it could potentially help others who had gone through some of the common obstacles and blockers of installing MySQL 5.0 on Solaris 10.


What motivates me to write this is that it was difficult for me find a comprehensive and workable “one paged” tutorial of doing this. After spending much time on the internet looking for clues and finally making the MySQL installation a success, I’ve decided to glue and share these pieces of information with others as well.

Assumption

  1. Readers are assumed to have at least some basic Unix/Linux administrative skills.
  2. Readers are assumed to have FRESH running copy of Solaris 10 6/06.
  3. Readers are assumed to have NO previously installed MySQL version in the system.
  4. Readers are assumed to have backed up any critical data before the installation.
  5. The MySQL version used for this tutorial is 5.0.24 Community Edition.
  6. Readers are to take full responsibility of any potential software, data, hardware, financial and life damages prior to following this tutorial.

Downloads

Please obtain a copy of MySQL 5.0 from http://dev.mysql.com/downloads/mysql/5.0.html. For the Solaris 10 MySQL packages, please scroll the page down the section of “Solaris (pkgadd package) downloads”. Choose the appropriate processor architecture of the package (either x86 or SPARC). Download the packages (both Standard and Max) and save them in an appropriate directory. I will use “/usr/files” as the directory where the mysql-xxx.pkg.gz files were placed through out the tutorial (Please take note that the xxx is the version number and is to be replaced by the actual text in the file name).

Preparation

Please perform the following as the root user. We have to make sure that any other previously running copies of MySQL are to be uninstalled from the system.

  1. Login as “root
  2. To list all the packages, type: “pkginfo | grep mysql” at the shell.
  3. If you see any listed packages, you may remove them by typing “pkgrm ” The names of the packages are list at the second column of after executing pkginfo.
  4. Change the directory to the place where you’ve downloaded the mysql-xxx.pkg.gz files. (e.g. “cd /usr/files“). If the files were compressed by gzip and you can see the .gz extension at the end of the files, you may decompress them by typing “gzip –d mysql-xxx.pkg.gz“. Decompress the downloaded mysql-xxx.pkg.gz files.

Installation

Follow these steps to perform the installation (perform as “root“):

  1. Create the mysql group by typing “groupadd mysql“.
  2. Create the mysql user by typing “useradd -g mysql mysql“.
  3. Change the directory where the MySQL packages were placed. “cd /usr/files“.
  4. First install the “Standard” package by typing: “pkgadd -d mysql-standard-xxx.pkg“. Just accept the default install directory (/opt/mysql) when prompted and go through the installation process.
  5. Next, install the “Max” package by typing: “pkgadd –d mysql-max-xxx.pkg“. Just accept the default directory when prompted and go through the installation process.
  6. The MySQL should have been installed in “/opt/mysql/mysql“.
  7. Change the directory to /etc/init.d and edit the “mysql” file with any text editor. Locate the line which states: “datadir=“. Change the line to “datadir=/opt/mysql/mysql/data“. Save the changes.
  8. After the installation, change the path to “/opt” and type this: “chown -R mysql:mysql mysql“. This is to change the ownership of the whole mysql directory.

Initializing the Database

  1. Change the operating user from “root” to “mysql” by tying: “su mysql“.
  2. Change the working directory to “/opt/mysql/mysql/scripts” by typing: “cd /opt/mysql/mysql/scripts“.
  3. Execute the mysql_db_install script by typing: “./mysql_install_db –user=mysql –ldata=/opt/mysql/mysql/data“.
  4. Change the working directory to “/opt/mysql/mysql/bin“.
  5. Start the database by typing: “./mysqld_safe –datadir=/opt/mysql/mysql/data –user=mysql &“.

Connecting to MySQL

Try to connect to the MySQL database by typing “mysql” as the root user. You should be able to see the “mysql>” prompt for the successful connection. The only user which could connect to the database now is the root user and it doesn’t require a password. For more information on user account management, please visit http://dev.mysql.com/doc/refman/5.0/en/user-account-management.html.

I hope this will help those who are trying to install the MySQL 5.0 database on the Solaris 10 OS for the first time. These pieces of software are some of the greatest works which were created by some of the most beautiful minds ever existed. Enjoy…

Related Articles

Previous Posts

MySQL Cluster NDB 7.2 on Solaris 10 Part 3 – Testing The Cluster

MySQL Cluster NDB 7.2 on Solaris 10 Part 3 - Testing The Cluster

September 22nd, 2012

We are back again to have fun with our cluster that we've setup written in our previous articles on [...]

MySQL Cluster NDB 7.2 on Solaris 10 Part 2 – Starting, Distributed Synchronized Users Management And Stopping The Cluster

MySQL Cluster NDB 7.2 on Solaris 10 Part 2 - Starting, Distributed Synchronized Users Management And Stopping The Cluster

September 18th, 2012

This is the continuation from the previous part of the tutorial MySQL Cluster NDB 7.2 on Solaris 10 [...]

MySQL Cluster NDB 7.2 on Solaris 10 Part 1 – How To Install, Setup and Configure

MySQL Cluster NDB 7.2 on Solaris 10 Part 1 - How To Install, Setup and Configure

September 18th, 2012

If you have landed on this page, we believe you might either had a bumpy ride in getting the MySQL c[...]

Quick Fix: How to Solve “Unable to read the logging configuration” on Netbeans7 with JBoss6

Quick Fix: How to Solve "Unable to read the logging configuration" on Netbeans7 with JBoss6

September 8th, 2012

This is just a quick fix post for those whom are having this problem when running JBoss 6.x with Net[...]

Making sense of EJB3.x Transaction Attributes – Part 4 (NEVER)

Making sense of EJB3.x Transaction Attributes – Part 4 (NEVER)

September 5th, 2012

This is the last part in the series of "Making sense of EJB3.x Transaction Attributes". So far, we'v[...]

Making sense of EJB3.x Transaction Attributes – Part 3 (Difference Between SUPPORTS and NOT_SUPPORTED)

Making sense of EJB3.x Transaction Attributes – Part 3 (Difference Between SUPPORTS and NOT_SUPPORTED)

September 5th, 2012

Oracle had extensively documented the behavior of each transaction attributes in the Java EE documen[...]

Making sense of EJB3.x Transaction Attributes – Part 2 (MANDATORY)

Making sense of EJB3.x Transaction Attributes - Part 2 (MANDATORY)

April 17th, 2012

In my previous post, we've discussed about TransactionAttributeType.REQUIRES_NEW: how it behaves and[...]

Making sense of EJB3.x Transaction Attributes – Part 1 (REQUIRES_NEW)

Making sense of EJB3.x Transaction Attributes - Part 1 (REQUIRES_NEW)

March 29th, 2012

For the previous past posts, I have dealth much with manual fine-grind transaction, mostly on the su[...]

EJB3.x JPA: When to use rollback() and setRollbackOnly()

EJB3.x JPA: When to use rollback() and setRollbackOnly()

March 23rd, 2012

After JTA was introduced for more than a decade ago, then later with the introduction of Bean-Manage[...]