First, you must download the software.
Head on over to http://www.mysql.com; click the "downloads" link, and choose the latest "stable" release.
Note | I prefer to get the source packages rather than the binary packages. This way, I get to see more of what is going on with the installation and feel that I have a little more control. These instructions cover installing MySQL from a source package. |
Download the source package, and put it into a directory where you can extract the .tar file.
Extract the source files.
tar -xzvf mysql-3.23.xx.tar.gz
As root, create the group and user for MySQL.
groupadd mysql useradd -g mysql mysql
Switch to the directory where the source files are located; this directory is created when you extract the files.
cd mysql-3.23.49
Run the configuration script.
./configure --prefix=/usr/local/mysql
Compile the source.
make
Install the files.
make install
Install the initial databases.
scripts/mysql_install_db
Change the ownership of the MySQL files.
chown -R root /usr/local/mysql chown -R mysql /usr/loca/mysql/var chgrp -R mysql /usr/local/mysql
Copy the configuration file to the /etc directory.
cp support-files/my-medium.cnf /etc/my.cnf
Start the MySQL daemon.
/usr/local/mysql/bin/safe_mysqld --user=mysql &
MySQL should now be up and running for you!