Welcome to CGI City - One of the biggest WWW Resources for CGI and Perl materials
Tips and Tutorials
How To Install MySQL
By: Tito Mijares


  • MySQL version 3.22.32
  • MySQL tarball downloaded into a dir named /home/_installer/mysql
  • Hardware has Red Hat Linux operating system.
  • User has root privileges.

1.0 Unpacking MySQL

# cd /home/_installer/mysql
# gzip -dc mysql* | tar xvf -
# mv mysql-3.22.32-pc-linux-gnu-i686 /usr/local
# cd /usr/local
# chown -R root:root mysql-3.22.32-pc-linux-gnu-i686
# ln -s /usr/local/mysql-3.22.32-pc-linux-gnu-i686 /usr/local/mysql

2.0 Configuring MySQL

note: assumes current directory is /usr/local

# cd mysql
# scripts/mysql_install_db

3.0 Starting the Server Manually

note: assumes current directory is /usr/local/mysql

# bin/safe_mysqld &
# bin/mysqladmin ping
mysqld is alive

4.0 Configuring MySQL root user

# bin/mysqladmin -u root password rootpassword

note: for our purposes, "rootpassword" is made similar to the system root password!

5.0 Testing access

# bin/mysql -uroot -p
mysql>use mysql;
mysql>select * from db;

6.0 Automatic MySQL Start-up during boot

# cd /usr/local/mysql
# cp support-files/mysql.server /etc/rc.d/init.d

note: to startup MySQL during system boot

# cd /etc/rc.d/rc3.d
# ln -s ../init.d/mysql.server S98mysql
# cd /etc/rc.d/rc5.d
# ln -s ../init.d/mysql.server S98mysql

note: to shutdown MySQL during system shutdown

# cd /etc/rc.d/rc0.d
# ln -s ../init.d/mysql.server S98mysql
# cd /etc/rc.d/rc6.d
# ln -s ../init.d/mysql.server S98mysql

note: make /etc/rc.d/init.d/mysql.server executable

# cd ../init.d
# chmod +x mysql.server

That's it!


Back to Tips and Tutorials

Search For:
Quick jump to
Home | About Us | Contact Us | Link To Us | Search
Tips & Tutorials | References | Books | Add A Resource
Custom Programming Services | Advertise
Disclaimer | Privacy Policy

Copyright © 1998-2099    CGI City    All Rights Reserved
All original materials contained herein including text, images, and original scripts written by CGI City, are copyrighted by CGI City. All other scripts and materials are copyrighted by their respective authors/owners.