installing mysql community server 5.1 - opensolaris

14
Installing MySQL Community Server 5.1 – OpenSolaris 2008.11 MySQL Clustering Installing MySQL Community Server 5.1 – OpenSolaris 2008.11 Objective To install MySQL Community Server 5.1 in OpenSolaris 2008.11. Pre-requisites 1. Download MySQL Community Server 5.1 from http://dev.mysql.com/downloads/mysql/5.1.html#downloads Assumptions 1. There isn’t any version of MySQL installed on the system. The installation of MySQL in OpenSolaris is primarily a three phase procedure – Preparation, Installation and Configuration. Procedure Preparation 1. OpenSolaris is mainly based on Solaris. Therefore the package available for Solaris 10 at the above URL should work well in OpenSolaris 2008.11. 2. Extract the downloaded file to obtain a file with a .pkg extension. 3. Before proceeding to installation, check for previous versions of MySQL present on the system using the following command – pkginfo | grep mysql

Upload: mysqlclustering3251

Post on 16-Nov-2014

732 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Installing MySQL Community Server 5.1 - OpenSolaris

Installing MySQL Community Server 5.1 – OpenSolaris 2008.11 MySQL Clustering

Installing MySQL Community Server 5.1 – OpenSolaris 2008.11

Objective

To install MySQL Community Server 5.1 in OpenSolaris 2008.11.

Pre-requisites

1. Download MySQL Community Server 5.1 from http://dev.mysql.com/downloads/mysql/5.1.html#downloads

Assumptions

1. There isn’t any version of MySQL installed on the system.

The installation of MySQL in OpenSolaris is primarily a three phase procedure – Preparation, Installation and Configuration.

Procedure

Preparation

1. OpenSolaris is mainly based on Solaris. Therefore the package available for Solaris 10 at the above URL should work well in OpenSolaris 2008.11.

2. Extract the downloaded file to obtain a file with a .pkg extension. 3. Before proceeding to installation, check for previous versions of MySQL present on the system

using the following command – pkginfo | grep mysql

Page 2: Installing MySQL Community Server 5.1 - OpenSolaris

Installing MySQL Community Server 5.1 – OpenSolaris 2008.11 MySQL Clustering

4. If there are any installations of MySQL on the system, it is preferable to remove them with the following command – pkgrm <pkg_name>

Page 3: Installing MySQL Community Server 5.1 - OpenSolaris

Installing MySQL Community Server 5.1 – OpenSolaris 2008.11 MySQL Clustering

5. It is recommended to create a group named mysql and a user in that group with the name mysql. Generally both the group and the user exist by default, so explicitly creating them isn’t required. If they are already present, the commands will give an error. Ignore them and move ahead. groupadd mysql useradd –g mysql mysql

Page 4: Installing MySQL Community Server 5.1 - OpenSolaris

Installing MySQL Community Server 5.1 – OpenSolaris 2008.11 MySQL Clustering

Page 5: Installing MySQL Community Server 5.1 - OpenSolaris

Installing MySQL Community Server 5.1 – OpenSolaris 2008.11 MySQL Clustering

Installation

1. Navigate to the directory containing the MySQL package

2. Start the installation with the following command – pkgadd –d solaris.pkg when prompted for the packages to be installed, specify all.

Page 6: Installing MySQL Community Server 5.1 - OpenSolaris

Installing MySQL Community Server 5.1 – OpenSolaris 2008.11 MySQL Clustering

3. If the directory /opt/mysql isn’t present, the setup will ask for permission to create it.

Page 7: Installing MySQL Community Server 5.1 - OpenSolaris

Installing MySQL Community Server 5.1 – OpenSolaris 2008.11 MySQL Clustering

4. The package contains scripts which use super-user privileges. Allow the package to use them.

5. After a short time, the installation will complete.

Page 8: Installing MySQL Community Server 5.1 - OpenSolaris

Installing MySQL Community Server 5.1 – OpenSolaris 2008.11 MySQL Clustering

Configuration

1. Navigate to /etc/init.d and open the file mysql using a text editor.

Page 9: Installing MySQL Community Server 5.1 - OpenSolaris

Installing MySQL Community Server 5.1 – OpenSolaris 2008.11 MySQL Clustering

2. Change the datadir in the file to /opt/mysql/mysql/data.

Page 10: Installing MySQL Community Server 5.1 - OpenSolaris

Installing MySQL Community Server 5.1 – OpenSolaris 2008.11 MySQL Clustering

3. Navigate to /opt and change the ownership of the mysql directory to the mysql user.

4. Change the user to mysql and navigate to the scripts directory - /opt/mysql/mysql/scripts.

Page 11: Installing MySQL Community Server 5.1 - OpenSolaris

Installing MySQL Community Server 5.1 – OpenSolaris 2008.11 MySQL Clustering

5. Run the mysql_install_db script using the following command – ./mysql_install_db --user=mysql --ldata=/opt/mysql/mysql/data

Page 12: Installing MySQL Community Server 5.1 - OpenSolaris

Installing MySQL Community Server 5.1 – OpenSolaris 2008.11 MySQL Clustering

6. The script completes its execution after a short while.

Page 13: Installing MySQL Community Server 5.1 - OpenSolaris

Installing MySQL Community Server 5.1 – OpenSolaris 2008.11 MySQL Clustering

7. Navigate to the bin directory and start mysqld_safe with the following command – ./mysqld_safe --datadir=../data --user=mysql

8. This starts the MySQL server. If the above command gives any errors and terminates unsuccessfully, delete the data directory and run step 5. Try the above command again and if errors still persist, check opensolaris.err present in the data directory with a text editor and proceed accordingly.

9. Finally start the MySQL client using the following command in the bin directory – ./mysql

Page 14: Installing MySQL Community Server 5.1 - OpenSolaris

Installing MySQL Community Server 5.1 – OpenSolaris 2008.11 MySQL Clustering

NOTE – The above screen shots use the name “solaris.pkg” for the downloaded package. However the name may differ and the appropriate name should be used.