First off, Google and download the file mysql-3.23.32.tar.gz [5.25M] to the /usr/local/src directory.
Next create a system user called mysql. This is not an actual user who would log into the system, but merely a username to run the MySQL service itself, from within the Unix environment.
Neither is this user an actual MySQL user itself. The actual MySQL users will be created later.
Create a user named mysql with the adduser command. Make them a part of the mysql group.
Use an empty password and a null shell (nologin):
adduser
Username: mysql
Full name: mysql
Uid (Leave empty for default):
Login group [mysql]:
Login group is mysql. Invite mysql into other groups? []:
Login class [default]:
Shell (sh csh tcsh bash nologin) [sh]: nologin
Home directory [/home/mysql]:
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]:yes
Lock out account after creation? [no]:
OK? (yes/no): yes
Move into the /usr/local/src diectory and unpack the mysql tarball:
tar -zxvf mysql-3.23.32.tar.gz
Move into the newly created mysql directory:
cd mysql-3.23.32
Next you need to build a configure script. This must be done as root:
vi mysqlscript
Inside the script type:
#!/bin/sh
#Mysql Configure Script
./configure --prefix=/usr/local/mysql \
--mandir=/usr/local/man \
--with-unix-socket-path=/usr/local/mysql/mysql.sock
Once you have saved and exited the script, run it:
sh mysqlscript
After this script runs do the following:
make
make install
Next you need to run the following command to initialise the mysql database:
scripts/mysql_install_db
Make the following links. (Be very careful here!!!):
ln -s /usr/local/mysql/bin/mysql /usr/local/sbin/mysql
ln -s /usr/local/mysql/bin/mysqladmin /usr/local/sbin/mysqladmin
ln -s /usr/local/mysql/bin/safe_mysqld /usr/local/sbin/safe_mysqld
To start the mysql server (in the background '&') run:
safe_mysqld &
(hit enter twice to get back to the prompt)
To test the server run:
mysqladmin version
mysqladmin status
- A.