Linux system installation MySQL

Source: Internet
Author: User

The Linux installation MySQL service is installed in two ways:

① source installation, the advantage is that the installation package is relatively small, only more than 10 m, the disadvantage is that the installation depends on the library, installation time is long, the installation steps are complex and error-prone;

② uses the official compiled binary file installation, the advantage is the installation speed, the installation step is simple, the disadvantage is that the installation package is large, about 300M. The following describes Linux using an officially compiled binary package to install MySQL.

Tools/Materials
    • Mysql-5.6.17-linux-glibc2.5-i686.tar.gz
    • Mysql-5.6.17-linux-glibc2.5-x86_64.tar.gz
    • Linux system, 32-bit, 64-bit can
Method/Step
  1. to MySQL website download mysql compiled binary installation package, on the download page select Platform: Option Select Linux-generic, then pull the page to the bottom, 64-bit system download linux-generic (GLIBC 2.5) (x86, 64-bit), 32-bit system download linux-generic (GLIBC 2.5) (x86, 32-bit)

  2. Unzip the 32-bit installation package:

    Go to the directory where the installation package is located, execute the command: Tar mysql-5.6.17-linux-glibc2.5-i686.tar.gz

  3. Copy the extracted MySQL directory to the local software directory of the system:

    Execute command: CP mysql-5.6.17-linux-glibc2.5-i686/usr/local/mysql-r

    Note: The end of the directory does not add/

  4. Add system MySQL Group and MySQL User:

    Execute command: Groupadd MySQL and useradd-r-g MySQL MySQL

  5. To install the database:

    Go to install MySQL software directory: Execute command cd/usr/local/mysql

    Modify current directory owner for MySQL User: Execute command chown-r mysql:mysql.

    Install database: Executes the command./scripts/mysql_install_db--user=mysql

    Modify the current directory owner as root User: Execute command chown-r root:root.

    Modify the current data directory owner for MySQL User: Execute command chown-r mysql:mysql data

    To this database installation is complete

  6. Start the MySQL service and add the boot MySQL service:

    Add Boot: Execute command CP Support-files/mysql.server/etc/init.d/mysql, put startup script into boot initialization directory

    Start MySQL service: Execute command service MySQL start

    Execute command: ps-ef|grep mysql see MySQL service description started successfully,

  7. To modify the root user password of MySQL, the root initial password is empty:

    Execute command:./bin/mysqladmin-u root password ' password '

  8. 8

    Put the MySQL client on the default path:

    Ln-s/usr/local/mysql/bin/mysql/usr/local/bin/mysql

    Note: It is recommended to use the soft chain in the past, do not directly package file copy, easy to install multiple versions of MySQL system

Linux system installation MySQL

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.