In Linux, how does one correctly install the MySQL database?

Source: Internet
Author: User

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

 
 
  1. tar zxf MySQL-standard-4.0.24-pc-linux-gnu-i686.tar.gz 

4. Create a directory connection

 
 
  1. ln -s MySQL-standard-4.0.24-pc-linux-gnu-i686 MySQL 

5. Create MySQL users and groups

 
 
  1. groupadd MySQL  
  2. 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.

 
 
  1. Su root # switch back to root user
  2. Cd/usr/local/MySQL
  3. Cp support-files/MySQL. server/etc/init. d/MySQL # copy the msql script file to the startup directory of the system.
  4. Cd/etc/init. d/
  5. Chkconfig -- add MySQL # add MySQL to the startup service list
  6. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.