The following articles mainly introduce how to install MySQL in the linux operating system. We installed MySQL in the system: linux as3 and MySQL in the environment of mysql-standard-4.0.24-pc-linux-gnu-i686.tar.gz, the following describes how to install MySQL.
System: linux as3
MySQL version: MySQL-standard-4.0.24-pc-linux-gnu-i686.tar.gz
Installation Method: Tarball Installation
MySQL installation path:/usr/local/MySQL
MySQL Installation Process
1. log on to the system as root
2. Copy the downloaded MySQL package to the appropriate location (/usr/lcoal
3. decompress the package
Cd/usr/local # enter the working directory
Tar zxf MySQL-standard-4.0.24-pc-linux-gnu-i686.tar.gz
4. Create a directory connection
Ln-s MySQL-standard-4.0.24-pc-linux-gnu-i686 MySQL
5. Create MySQL users and groups
Groupadd MySQL
Useradd-g MySQL
6. Change the access permission of the MySQL directory.
Chown-R MySQL. # ensure that the current directory is/usr/lcoal/MySQL.
Chgrp-R MySQL.
7. Run the configuration script as a MySQL user
Su-m MySQL # Switch to MySQL user
Cd/usr/local/MySQL # note that after switching the user, the working directory is no longer/usr/local/MySQL. So you have to repeat it.
./Configure # execute the configuration script
8. At this point, the installation has been completed. In some documents, you still need to execute scripts/MySQL_install_db. In fact, this statement is not required because the configure script has already executed this statement. If you execute more statements, an error may occur.
9. Check whether MySQL is successfully installed.
/Usr/local/MySQL/bin/MySQL
If a MySQL prompt is displayed, it indicates that the prompt is successful!
10. automatically enable the MySQL service when the system starts.
Su root # switch back to root user
Cd/usr/local/MySQL
Cp support-files/MySQL. server/etc/init. d/MySQL # copy the msql script file to the startup directory of the system.
Cd/etc/init. d/
Chkconfig -- add MySQL # add MySQL to the startup service list
Chkconfig MySQL on # enable MySQL service automatically when the system starts
The above content is an introduction to installing MySQL in linux.