MySQL
How to Build MySQL source code on Solaris
Introduction
This
document describes the steps required to build MySQL source code on Solaris
Installed Solaris Version Details
# uname -a
SunOS clear02 5.11 snv_104 sun4u sparc SUNW,Sun-Fire-880
# more /etc/release
Solaris Express Community Edition snv_104 SPARC
Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 02 December 2008
MySQL Download
-
As mysql user, Download Compressed gnu source archive for MySQL 5.1 from the following location:
scroll
down to Source downloads section. Download
Compressed
GNU TAR archive (tar.gz)5.1.30 which is 27.7M
MySQL Environment Setup
-
Generate Optimized binary using Sun Studio compiler and optimized compiler options.
Sun Studio Compiler can be downloaded from
-
Make sure Sun compiler, gnu Make and Sun's nm (/usr/ccs/bin) is in the path:
-
gmake:
-
gmake is under /usr/sfw/bin directory.
-
Create a sym link from gmake to make
-
cd /usr/sfw/bin ; ln -s gmake make
-
-
C compiler
-
Path to SPARC C compiler
In my installation it is under,
/shared/dp/mars/stable/sparc-S2.inst/opt/SUNWspro/bin
and can be downloaded from
-
Path to nm, ar utility /usr/ccs/bin.
-
Path is set as under:
-
SPARC :
example:
export PATH=$PATH:/usr/sbin:/usr/sfw/bin:/shared/dp/mars/stable/sparc-S2.inst/opt/SUNWspro/bin:/usr/ccs/bin
-
MySQL Source Installation
Pre-installation Checklist
Solaris comes with MySQL installed. Use pkgrm <package-name> to remove all mysql packages.
#pkginfo | grep mysql
SUNWapu13dbd-mysql/
SUNWmysql-python/
SUNWmysql5jdbc/
SUNWmysql5r/
SUNWmysql5test/
SUNWmysql5u/
SUNWmysqlr/
SUNWmysqlt/
SUNWmysqlu/
SUNWphp52r-mysql/
SUNWphp52u-mysql/
Example
# pkgrm SUNWmysql5u
MySQL Build and Installation
# echo $PATH /usr/sbin:/usr/sfw/bin:/shared/dp/mars/stable/sparc-S2.inst/opt/SUNWspro/bin:/usr/ccs/bin:/usr/sbin:/usr/bin #pwd /export/home/mysql/src #gzip -d mysql-5.1.30.tar.gz #tar xvf mysql-5.1.30.tar #cd mysql-5.1.30 #pwd /export/home/mysql/src/mysql-5.1.30
-
Invoke the configure
-
./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --enable-assembler
-
Then issue :
-
make all
-
-
Finally:
-
make install
-
-
This will install MySQL in /usr/local/mysql directory
MySQL Database setup
#cd /usr/local/mysql #groupadd mysql #useradd -g mysql mysql #chown -R mysql . #chgrp -R mysql . #scripts/mysql_install_db –user=mysql #chown -R root . #chown -R mysql var #bin/mysqld_safe --user=mysql & Installing MySQL system tables...
...
...
OK
Create password for the MySQL root user
In the below example, we are creating root user password and password is set to “mysql”
#./bin/mysqladmin -u root password <mysql> # bin/mysql -u root -p Enter password: <mysql>
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1332
Server version: 5.1.30 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases
-> ;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.00 sec)
mysql>
Posted at 09:38AM Jan 05, 2009 by Arathi Krishnaiyengar in MySQL | Comments[0]
Monday Jan 05, 2009