MySQL 4.1.21
Building a Web Server, for Linux
Requirements
Perl
Download
Package(Linux x86, non-rpm) : Select mysql-standard-4.1.21-pc-linux-gnu-i686-glibc23.tar.gz from mirror.
Our Configuration
Install to : /usr/local/mysql
Setup
Unpack, place, and symlink...
...]# tar -xzf mysql-standard-4.1.21-pc-linux-gnu-i686-glibc23.tar.gz...]# mv mysql-standard-4.1.21-pc-linux-gnu-i686-glibc23 /usr/local/...]# cd /usr/local/usr/local]# ln -s mysql-standard-4.1.21-pc-linux-gnu-i686-glibc23 mysql
Create Mysql User and Group
Note that, chances are good, the MySQL user/group is already established on your system.
Create new group 'mysql' under /etc/group, and add new user 'mysql' under the group 'mysql'...
/usr/local]# cd mysql/usr/local/mysql]# groupadd mysql/usr/local/mysql]# useradd -g mysql mysql
my.cnf
The location of my.cnf is searched in the order of: global options - /etc/my.cnf, server-specific options - /usr/local/mysql/data/my.cnf, user-specific options - ~/my.cnf
/usr/local/mysql]# cp support-files/my-medium.cnf /etc/my.cnf
Note that if you are using PHP 4.4 to access MySQL 4.1+, you can only do so with the built in php extension 'php_mysql' [vs. extension 'php_mysqli' that ships with PHP 5], and will need to revert, under MySQL, to the old_password hash method...
Edit my.cnf, add to section '[mysqld]'...
old_passwords = 1
Initialize Database
Create the mysql database, privilege tables, and the func table...
/usr/local/mysql]# ./scripts/mysql_install_db --user=mysql
Directory Premissions
Change user:group ownership to 'root:mysql' under all files and directories of /usr/local/mysql...
/usr/local/mysql]# chown -R root:mysql .
Change user:group ownership to 'mysql:mysql' under all files and directories of /usr/local/mysql/data...
/usr/local/mysql]# chown -R mysql:mysql data
Startup
Start the MySQL Daemon
There are several ways to start the MySQL daemon, choose one that suits your needs.
[Default] Listen on all interfaces (0.0.0.0)...
/usr/local/mysql]# ./bin/mysqld_safe --user=mysql &
Listen on loopback only (127.0.0.1)...
/usr/local/mysql]# ./bin/mysqld_safe --user=mysql --bind-address=127.0.0.1 &
[sanity check] MySQL Process...
...]# ps -auxfwwroot ... /bin/sh /usr/local/mysql/bin/safe_mysqld --user=mysql --bind-address=127.0.0.1
mysql ... /usr/local/mysql/bin/mysqld --defaults-extra-file=/usr/local/mysql/data/my.cnf --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=/usr/local/mysql/data/<systemname>.pid --skip-external-locking --port=3306 --socket=/tmp/mysql.sock --bind-address=127.0.0.1
Cleanup
Remove anonymous users, remove remote instance of user 'root', and delete test database with privileges set...
/usr/local/mysql]# ./bin/mysql_secure_installation
MySQL Shell
Enter the command-line MySQL interface...
/usr/local/mysql/bin]# ./mysql -u <user> -p<password>
[note that there is no space between '-p' and 'password', and that characters '<' and '>' are not typed]
Shutdown the MySQL daemon...
/usr/local/mysql/bin]# ./mysqladmin -u <user> -p<password> shutdown
[note that there is no space between '-p' and 'password', and that characters '<' and '>' are not typed]
Help
Display help options...
/usr/local/mysql/bin]# ./mysqld --help
See what values a running MySQL server is using...
/usr/local/mysql/bin]# ./mysqladmin -u <user> -p<password> variables
Display MySQL server extended status...
/usr/local/mysql/bin]# ./mysqladmin -u <user> -p<password> extended-status
Display MySQL version information...
/usr/local/mysql/bin]# ./mysqladmin -V

