- Make the directory to hold MySQL files, add the MySQL group and a MySQL user for the database.
#mkdir /usr/local/mysql
#groupadd mysql
#useradd -g mysql mysql
- Unzip and unTar the source
#gzip -cd mysql-3.23.44.tar.gz | tar xvf -
- Change to the newly created directory
#cd mysql-3.23.44
- Run the configure script and set the location
#./configure --prefix=/usr/local/mysql
- Run make to create the binaries
#make
- Run make install to install the binaries -you will need to be 'root' to do this.
#make install
- If this is the first install of MySQL, make the grant tables with the following script.
#{source}/scripts/mysql_install_db
- Change the ownership of the MySQL binary to root and the data directory to the user you run mysqld as (the -R changes ownership recursively).
#chown -R root /usr/local/mysql
#chown -R mysql /usr/local/mysql/var
#chgrp -R mysql /usr/local/mysql
- Start the MySQL Daemon
#/usr/local/mysql/bin/safe_mysqld &
- Set the password for the MySQL root user
#/usr/local/mysql/bin/mysqladmin -u root password 'password'
#Enter Password:
- Test the MySQL Daemon with:
#{source}/sql-bench/run-all-tests
- Set up the script to start and stop mysqld at the appropriate run level at each start up.
#cd {source}/support-files
#cp mysql.server /etc/rc.d
#cd /etc/rc.d
#chmod 744 mysql.server
#cd rc3.d
#ln -s ../mysql.server S11MySQL
#ln -s ../mysql.server K11MySQL
- Connect to MySQL
#/usr/local/mysql/bin/mysql --user=root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 3.23.44
mysql> status
--------------
mysql Ver 11.13 Distrib 3.23.44, for pc-linux-gnu (i686)
Connection id: 2
Current database:
Current user: root@localhost
Current pager: stdout
Using outfile: ''
Server version: 3.23.44
Protocol version: 10
Connection: Localhost via UNIX socket
Client characterset: latin1
Server characterset: latin1
UNIX socket: /tmp/mysql.sock
Uptime: 2 min 50 sec
Threads: 1 Questions: 2 Slow queries: 0 Opens: 6 Flush tables: 1
Open tables: 0 Queries per second avg: 0.012
--------------
mysql>