One Kobo dot Com

Installing MySQL On Linux

[root@lucy upck]# groupadd mysql
[root@lucy upck]#
useradd -g mysql mysql
[root@lucy upck]#
cat /etc/group | grep -i mysql

[root@lucy upck]# cat /etc/passwd | grep mysql

[root@lucy upck]# gunzip mysql-5.0.37.tar.gz

[root@lucy upck]# ll
total 139544
-rw-r--r-- 1 root root 93859840 Mar 23 22:37 mysql-5.0.37.tar
drwxr-xr-x 16 sigalert sigalert 4096 Mar 23 22:09 php-5.2.1
-rw-rw-r-- 1 sigalert sigalert 48875520 Mar 23 18:48 php-5.2.1.tar

[root@lucy upck]# tar xvf mysql-5.0.37.tar

[ ~ 2000 Lines Deleted ]


[root@lucy upck]# ls

[root@lucy upck]# cd mysql-5.0.37

[root@lucy mysql-5.0.37]# pwd

[root@lucy mysql-5.0.37]# ./configure --prefix=/opt/mysql
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking "character sets"... default: latin1, collation: latin1_swedish_ci; compiled in: latin1 latin1 utf8

[ Lines Deleted ]

config.status: creating usr/Makefile
config.status: creating ib_config.h
config.status: ib_config.h is unchanged
config.status: executing depfiles commands
MySQL has a Web site at which carries details on the
latest release, upcoming features, and other information to make your
work or play with MySQL more productive. There you can also find
information about mailing lists for MySQL discussion.
Remember to check the platform specific part of the reference manual for
hints about installing MySQL on your platform. Also have a look at the
files in the Docs directory.
Thank you for choosing MySQL!

[root@lucy mysql-5.0.37]# make
cd libmysql; make link_sources
make[1]: Entering directory `/tmp/upck/mysql-5.0.37/libmysql'
set -x; \
ss=`echo strmov.lo strxmov.lo strxnmov.lo strnmov.lo strmake.lo strend.lo strtod.lo strnlen.lo strfill.lo is_prefix.lo int2str.lo str2int.lo strinstr.lo strcont.lo strcend.lo bcmp.lo ctype-latin1.lo bchange.lo bmove.lo bmove_upp.lo longlong2str.lo strtoull.lo strtoll.lo llstr.lo my_vsnprintf.lo ctype.lo ctype-simple.lo ctype-bin.lo ctype-mb.lo ctype-big5.lo ctype-czech.lo ctype-cp932.lo ctype-eucjpms.lo ctype-euc_kr.lo ctype-win1250ch.lo ctype-utf8.lo ctype-extra.lo ctype-ucs2.lo ctype-gb2312.lo ctype-gbk.lo ctype-sjis.lo ctype-tis620.lo ctype-ujis.lo ctype-uca.lo xml.lo my_strtoll10.lo str_alloc.lo | sed "s;\.lo;.c;g"`; \
ds=`echo dbug.lo | sed "s;\.lo;.c;g"`; \
ms=`echo my_init.lo my_static.lo my_malloc.lo my_realloc.lo my_create.lo

[ Too Many To Count Lines Deleted

g++ -O3 -DDBUG_OFF -fno-implicit-templates -fno-exceptions -fno-rtti -rdynamic -o mysqlmanager command.o mysqlmanager.o manager.o log.o thread_registry.o listener.o protocol.o mysql_connection.o user_map.o messages.o commands.o instance.o instance_map.o instance_options.o buffer.o parse.o guardian.o parse_output.o ./.libs/liboptions.a -lpthread -lpthread -lpthread -lpthread libnet.a ../../vio/libvio.a ../../mysys/libmysys.a ../../strings/libmystrings.a ../../dbug/libdbug.a -lz -lpthread -lcrypt -lnsl -lm -lpthread
make[3]: Leaving directory `/tmp/upck/mysql-5.0.37/server-tools/instance-manager'
make[3]: Entering directory `/tmp/upck/mysql-5.0.37/server-tools'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/tmp/upck/mysql-5.0.37/server-tools'

[root@lucy mysql-5.0.37]# make install
make install-recursive
make[1]: Entering directory `/tmp/upck/mysql-5.0.37'
Making install in .
make[2]: Entering directory `/tmp/upck/mysql-5.0.37'
make[3]: Entering directory `/tmp/upck/mysql-5.0.37'

[ Lines Deleted ]

Libraries have been installed in:
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and manual pages.

[ Lines Deleted ]

make[3]: Leaving directory `/tmp/upck/mysql-5.0.37/server-tools'
make[2]: Leaving directory `/tmp/upck/mysql-5.0.37/server-tools'
make[1]: Leaving directory `/tmp/upck/mysql-5.0.37'

[root@lucy mysql-5.0.37]# cd scripts

[root@lucy scripts]# ./mysql_install_db --user=mysql
Installing all prepared tables
Fill help tables
To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system
To do so, start the server, then issue the following commands:
/opt/mysql/bin/mysqladmin -u root password 'new-password'
/opt/mysql/bin/mysqladmin -u root -h lucy password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd /opt/mysql ; /opt/mysql/bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests
Please report any problems with the /opt/mysql/bin/mysqlbug script!
The latest information about MySQL is available on the web at
Support MySQL by buying support/licenses at

[root@lucy scripts]# cp /tmp/upck/mysql-5.0.37/support-files/mysql.server /etc/init.d

[root@lucy scripts]# chmod a+x /etc/init.d/mysql.server

[root@lucy scripts]# ln -s /etc/init.d/mysql.server /etc/rc3.d/S99mysql
[root@lucy scripts]# ln -s /etc/init.d/mysql.server /etc/rc0.d/K01mysql

[root@lucy scripts]# ls /etc/rc3.d/S99*

[root@lucy scripts]# chown -R root /opt/mysql
[root@lucy scripts]# chown -R mysql /opt/mysql/var
[root@lucy scripts]# chgrp -R mysql /opt/mysql

[root@lucy scripts]# cp /tmp/upck/mysql-5.0.37/support-files/my-large.cnf /etc/my.cnf

[root@lucy scripts]# /opt/mysql/bin/mysqld_safe --user=mysql &
[1] 23044
Starting mysqld daemon with databases from /opt/mysql/var

[root@lucy scripts]# ps -ef|grep sql
root 23044 6183 0 00:20 pts/6 00:00:00 /bin/sh /opt/mysql/bin/mysqld_safe --user=mysql
mysql 23068 23044 0 00:20 pts/6 00:00:00 /opt/mysql/libexec/mysqld --basedir=/opt/mysql --datadir=/opt/mysql/var --user=mysql --pid-file=/opt/mysql/var/ --skip-external-locking --port=3306 --socket=/tmp/mysql.sock

[root@lucy scripts]# /opt/mysql/bin/mysqladmin shutdown
STOPPING server from pid file /opt/mysql/var/
070324 00:20:59 mysqld ended
[1]+ Done /opt/mysql/bin/mysqld_safe --user=mysql

[root@lucy scripts]# service mysql.server start

[root@lucy scripts]# ps -ef|grep mysqld
root 23117 1 0 00:21 pts/6 00:00:00 /bin/sh /opt/mysql/bin/mysqld_safe --datadir=/opt/mysql/var --pid-file=/opt/mysql/var/
mysql 23144 23117 0 00:21 pts/6 00:00:00 /opt/mysql/libexec/mysqld --basedir=/opt/mysql --datadir=/opt/mysql/var --user=mysql --pid-file=/opt/mysql/var/ --skip-external-locking --port=3306 --socket=/tmp/mysql.sock

[root@lucy scripts]# service mysql.server stop
Shutting down MySQL. SUCCESS!

[root@lucy scripts]# ps -ef | grep mysqld
root 23195 6183 0 00:27 pts/6 00:00:00 grep mysqld