MySQL

pageicon Monday Jan 05, 2009

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

      scroll down to Source downloads section. Download
      Compressed GNU TAR archive (tar.gz)5.1.30 which is 27.7M

MySQL Environment Setup

  • 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 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>

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed

« November 2009
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
Today

Feeds

Search this blog

Links

Weblog menu

Today's referrers

Today's Page Hits: 22