Thursday, March 11, 2010

Install MySQL 5.0.27 on Solaris 5.10

Compilation from Source (GCC 3.4.6)

Get the Source

A distribution mysql-5.0.27.tar.gz (20 Oct 2006, 24.7M) was downloaded from MySQL website and stored in /usr/local/software.

Pre-Compile Config

All default except install location:

./configure --prefix=/usr/local/mysql
configure:22606: WARNING: term.h: present but cannot be compiled
configure:22608: WARNING: term.h: check for missing prerequisite headers?
configure:22610: WARNING: term.h: see the Autoconf documentation
configure:22612: WARNING: term.h: section "Present But Cannot Be Compiled"
configure:22614: WARNING: term.h: proceeding with the preprocessor's result
configure:22616: WARNING: term.h: in the future, the compiler will take precedence
configure:22628: checking for term.h
.
.
configure:32423: WARNING: sys/ptem.h: present but cannot be compiled
configure:32425: WARNING: sys/ptem.h: check for missing prerequisite headers?
configure:32427: WARNING: sys/ptem.h: see the Autoconf documentation
configure:32429: WARNING: sys/ptem.h: section "Present But Cannot Be Compiled"
configure:32431: WARNING: sys/ptem.h: proceeding with the preprocessor's result
configure:32433: WARNING: sys/ptem.h: in the future, the compiler will take precedence
configure:32445: checking for sys/ptem.h 

Check configure.log found:

configure:23024: checking term.h usability
configure:23036: gcc -c     conftest.c >&5
In file included from conftest.c:102:
/usr/include/term.h:1034: error: syntax error before "bool"
/usr/include/term.h:1060: error: syntax error before "SGTTY"
/usr/include/term.h:1081: error: syntax error before "sgr_mode"
/usr/include/term.h:1082: error: syntax error before "sgr_faked"
/usr/include/term.h:1092: error: syntax error before "funckeystarter"
/usr/include/term.h:1094: error: syntax error before "_fl_rawmode"
/usr/include/term.h:1101: error: syntax error before "_input_queue"
/usr/include/term.h:1108: error: syntax error before '*' token
/usr/include/term.h:1111: error: syntax error before "bit_vector"
/usr/include/term.h:1115: error: syntax error before "check_turn_off"
/usr/include/term.h:1116: error: syntax error before "non_faked_mode"
/usr/include/term.h:1117: error: syntax error before "_cur_pair"
/usr/include/term.h:1118: error: syntax error before '*' token
/usr/include/term.h:1120: error: syntax error before '}' token
/usr/include/term.h:1207: error: syntax error before "int"
/usr/include/term.h:1207: error: `vidputs' declared as function returning a function
/usr/include/term.h:1207: error: syntax error before ')' token
configure:23042: $? = 1
configure: failed program was:
| /* confdefs.h.  */
configure:34054: checking sys/ptem.h usability
configure:34066: gcc -c -O3 -DDBUG_OFF    -DHAVE_RWLOCK_T  conftest.c >&5
In file included from conftest.c:169:
/usr/include/sys/ptem.h:25: error: syntax error before "mblk_t"
/usr/include/sys/ptem.h:29: error: syntax error before '}' token
configure:34072: $? = 1
configure: failed program was:
| /* confdefs.h.  */

It seems that two files could not be compiled due to syntax errors. Could be GCC version problem. The warning does not affect the compilation.

Compilation Error

./gen_lex_hash > lex_hash.h-t
ld.so.1: gen_lex_hash: fatal: libstdc++.so.6: open failed: No such file or directory
/bin/bash: line 1: 5234 Killed ./gen_lex_hash >lex_hash.h-t
make[1]: *** [lex_hash.h] Error 137

Library libstdc++ is not on path. Need adding LD_LIBRARY_PATH.

Direct Installation from Binary (Standard & max)

Didn't adopt the installation from source and install from binary directly.

Get the Distributions

Two files: mysql-standard-5.0.27-solaris10-x86_64.pkg & mysql-max-5.0.27-solaris10-x86_64.pkg.

Installation Steps

Installing MySQL 5.0 on Solaris 10

Post Installation Config

Modify mysql @ /usr/init.d/

basedir=/opt/mysql/mysql
#datadir=/var/lib/mysql
datadir=/data

Create my.cnf @ /etc/

[mysqld]
basedir=/opt/mysql/mysql
datadir=/data
lower_case_table_names=1

Remove Most Symlinks About MySQL

The following directories are found to contains symlinks to MySQL:

rm -rf /usr/sbin/mysql.symlinks.2010-03-12
rm -rf /usr/local/mysql.2010-03-12
rm -rf /usr/include/mysql
rm -rf /usr/bin/mysql.symlinks

rm /usr/share/man/man1/msql2mysql.1
rm /usr/share/man/man1/mysql_config.1
rm /usr/share/man/man1/mysql_explain_log.1
rm /usr/share/man/man1/mysql_fix_privilege_tables.1
rm /usr/share/man/man1/mysql_upgrade.1
rm /usr/share/man/man1/mysql_zap.1
rm /usr/share/man/man1/mysql.1
rm /usr/share/man/man1/mysql.server.1
rm /usr/share/man/man1/mysqlaccess.1
rm /usr/share/man/man1/mysqladmin.1
rm /usr/share/man/man1/mysqlbinlog.1
rm /usr/share/man/man1/mysqlcheck.1
rm /usr/share/man/man1/mysqld_multi.1
rm /usr/share/man/man1/mysqld_safe.1
rm /usr/share/man/man1/mysqld.1
rm /usr/share/man/man1/mysqldump.1
rm /usr/share/man/man1/mysqlhotcopy.1
rm /usr/share/man/man1/mysqlimport.1
rm /usr/share/man/man1/mysqlman.1
rm /usr/share/man/man1/mysqlmanager.1
rm /usr/share/man/man1/mysqlshow.1
rm /usr/share/man/man1/safe_mysqld.1

rm /usr/sfw/include/mysql

rm /usr/info/mysql.info
rm /usr/lib/libmysqlclient_r.a
rm /usr/lib/libmysqlclient.a

mysqld_safe Change Due to Symlink Removal

All /usr/local/mysql strings are replaced by /opt/mysql/mysql. Now the MySQL server can be started by just typing:

# mysqld_safe

No comments: