Friday, June 25, 2010

Installing MYSQL in Solaris10


Getting the binary

Available @ http://www.mysql.com
I have used MYSQL 5.1.34 here.
mysql-5.1.34-solaris10-sparc-64bit.tar.gz

Extracting the binary

bash-3.00# pwd
/export/home/mysql
bash-3.00# ls
mysql-5.1.34-solaris10-sparc-64bit.tar.gz
bash-3.00# gunzip mysql-5.1.34-solaris10-sparc-64bit.tar.gz
bash-3.00# tar -xvf mysql-5.1.34-solaris10-sparc-64bit.tar
bash-3.00# ls
mysql-5.1.34-solaris10-sparc-64bit.tar
mysql-5.1.34-solaris10-sparc-64bit
bash-3.00# cd mysql-5.1.34-solaris10-sparc-64bit
bash-3.00# pwd
/export/home/mysql/mysql-5.1.34-solaris10-sparc-64bit
bash-3.00# ls
COPYING bin lib share
EXCEPTIONS-CLIENT data man sql-bench
INSTALL-BINARY docs mysql-test support-files
README include scripts
bash-3.00# cd bin/
bash-3.00# file mysql
mysql: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped

Adding group and user

bash-3.00# groupadd mysql
bash-3.00# useradd -g mysql mysql

Creating Soft link

bash-3.00# mkdir /usr/local
bash-3.00# cd /usr/local/
bash-3.00# pwd
/usr/local
bash-3.00# ln -s /export/home/mysql/mysql-5.1.34-solaris10-sparc-64bit mysql
bash-3.00# ls -ltr
total 2
lrwxrwxrwx 1 root root 53 Jun 5 13:08 mysql -> /export/home/mysql/mysql-5.1.34-solaris10-sparc-64bit
bash-3.00#
bash-3.00# cd mysql
bash-3.00# chown -R mysql .
bash-3.00# chgrp -R mysql .

Run MYSQL initialization scipts

bash-3.00# scripts/mysql_install_db --user=mysql
Installing MySQL system tables...
090605 13:10:51 [Warning] Forcing shutdown of 2 plugins
OK
Filling help tables...
090605 13:10:51 [Warning] Forcing shutdown of 2 plugins
OK

Change Permissions

bash-3.00# chown -R root .
bash-3.00# ls -ltr
total 96
drwxr-xr-x 2 root mysql 512 Apr 1 12:34 docs
drwxr-xr-x 2 root mysql 1024 Apr 1 12:34 include
drwxr-xr-x 4 root mysql 512 Apr 1 12:35 man
drwxr-xr-x 3 root mysql 1024 Apr 1 12:35 lib
drwxr-xr-x 10 root mysql 512 Apr 1 12:40 mysql-test
drwxr-xr-x 27 root mysql 1024 Apr 1 12:40 share
drwxr-xr-x 5 root mysql 1024 Apr 1 12:40 sql-bench
drwxr-xr-x 2 root mysql 512 Apr 1 12:40 support-files
drwxr-xr-x 2 root mysql 512 Apr 1 12:40 scripts
drwxr-xr-x 2 root mysql 1536 Apr 1 12:40 bin
-rw-r--r-- 1 root mysql 1410 Apr 1 12:40 README
-rw-r--r-- 1 root mysql 8769 Apr 1 12:40 INSTALL-BINARY
-rw-r--r-- 1 root mysql 5139 Apr 1 12:40 EXCEPTIONS-CLIENT
-rw-r--r-- 1 root mysql 19071 Apr 1 12:40 COPYING
drwxr-x--- 4 root mysql 512 Jun 5 13:10 data
bash-3.00#
bash-3.00# chown -R mysql data

Selecting required server configuration

bash-3.00# cd support-files/
bash-3.00# ls
binary-configure config.small.ini my-innodb-heavy-4G.cnf my-small.cnf mysqld_multi.server
config.huge.ini magic my-large.cnf mysql-log-rotate ndb-config-2-node.ini
config.medium.ini my-huge.cnf my-medium.cnf mysql.server
bash-3.00#

bash-3.00# cp my-huge.cnf /etc/my.cnf

Here I have used my-huge.cnf configuration.

Start MYSQL

bash-3.00# bin/mysqld_safe --user=mysql &
[1] 5458
bash-3.00# 090605 13:28:01 mysqld_safe Logging to '/export/home/mysql/mysql-5.1.34-solaris10-sparc-64bit/data/deepakraja.err'.
090605 13:28:01 mysqld_safe Starting mysqld daemon with databases from /export/home/mysql/mysql-5.1.34-solaris10-sparc-64bit/data

Login to MYSQL

bash-3.00# ./mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.34-log MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.00 sec)

Change mysql root user password

mysql> use mysql
Database changed

mysql> update user set password=PASSWORD('adminadmin') where user='root';
Query OK, 2 rows affected (0.00 sec)
Rows matched: 3 Changed: 2 Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye
bash-3.00# ./mysql -uroot
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
bash-3.00# ./mysql -uroot -padminadmin
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.1.34-log MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

No comments:

Post a Comment