Showing posts with label Garvan. Show all posts
Showing posts with label Garvan. Show all posts

Friday, March 26, 2010

Solaris FAQ

wget etc Cannot Resolve Host Name

Need to add DNS server list in /etc/resolv.conf with the following content:

domain garvan.unsw.edu.au
nameserver xxx.xxx.xxx.xxx

gpg: Can't check signature: public key not found

Need to import pub key into gpg:

gpg --import *.asc

When installing perl DBI, it complains:

Need to import pub key into gpg:

CPAN.pm needs either both external programs tar and gzip installed or
both the modules Archive::Tar and Compress::Zlib. Neither prerequisite
is available. Can't continue.

How To Resolve – CPAN.pm needs tar, gzip and bzip2 installed – error message

Thursday, March 11, 2010

ptest (Solaris 5.10) Changes Tracking Log

User & Group Change @ 11/02/2010

New account pwbc_dba has been added for DB system administrative purpose, new group dbadmin is also added so other user login can participate DB administration without knowing pwbc_dba account.

groupadd dbadmin
useradd -m -g dbadmin -G root,it,other pwbc_dba
passwd pwbc_dba
usermod –s /bin/bash pwbc_dba (to use .profile to define env)

The password is the same as current mysql account. All database administrative tasks such as installation, upgrade etc should be done under pwbc_dba.

15/03/2010 pwbc_dba has been replaced by user mysql that is required by MySQL installation.

System $PATH Change @ 11/03/2010

New export has been added into /etc/profile so gtar and make are available system-wide.

LD_LIBRARY_PATH is added to address MySQL compilation error due to libstdc++.so.6 not found.

export PATH="$PATH:/opt/csw/bin:/usr/ccs/bin"
export LD_LIBRARY_PATH="/usr/local/lib:/usr/sfw/lib"

Change comment has been added on the source file. Future $PATH change will be recorded by comment and will not be added in here.

Change root SHELL to BASH

Justification: Did you know: root shell in Solaris 10

cat /etc/passwd

root:x:0:0:Super-User:/:/usr/bin/bash
daemon:x:1:1::/:
bin:x:2:2::/usr/bin:
sys:x:3:3::/:
derlin:x:103:101:Derrick Lin PTest Zone:/home/derlin:/bin/bash
mysql:x:105:103:MySQL user PTest Zone:/home/mysql:/bin/bash

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