This article mainly tells you love to install MySQL database under Linux actual operation process, we are in the system: linux as3, MySQL database version: MySQL-standard-4.0.24-pc-linux-gnu-i686.tar.gz.
Installation Method: Install tarball
MySQL installation path:/usr/local/MySQL
MySQL Database Installation Process
1. log on to the system as root
2. Copy the downloaded installation 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 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 MySQL database has been installed. In some documents, you still need to execute scripts/MySQL_install_db. In fact, you do not need to execute this statement because the configure script has already executed this statement. If you execute more statements, an error may occur.
9. Check whether the installation is successful.
/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
After the system is restarted, run/usr/local/MySQL/bin/MySQL. If a MySQL prompt is displayed, the entire MySQL database is successfully installed.
Original article title: Install MySQL database in linux
Connection: http://www.cnblogs.com/jdonson/archive/2010/05/21/1740904.html