"MySQL" Binary distribution installation

Source: Internet
Author: User

Operating system: Red Hat Enterprise Linux Server Release 6.5

MySQL installation package: mysql-5.6.34-linux-glibc2.5-x86_64.tar.gz

1. Create MySQL group and MySQL user in Linux

[Email protected] ~]# groupadd-g MySQL

[Email protected] ~]# useradd mysql-g mysql-p MySQL

2. Upload the installation package to the/usr/local directory

---upload process slightly---

3. Unzip the installation package

[Email protected] local]# TAR-ZXVF mysql-5.6.34-linux-glibc2.5-x86_64.tar.gz

4. Change the installation package name to ' MySQL ' after unpacking

[[Email protected] local]# mv mysql-5.6.34-linux-glibc2.5-x86_64 MySQL

5. Authorization: The extracted document belongs to the main group and changed to Root:root, where data is changed to Mysql:mysql

[Email protected] ~]# Cd/usr/local/mysql

[Email protected] mysql]# chown Root:root *

[Email protected] mysql]# chown mysql:mysql data

[email protected] mysql]# LL

Total 68

Drwxr-xr-x. 2 root root 4096 Jan 9 22:26 Bin

-rw-r--r--. 1 root root 17987 Sep 19:41 COPYING

Drwxr-xr-x. 3 MySQL mysql 4096 Jan 9 22:26 data

Drwxr-xr-x. 2 root root 4096 Jan 9 22:26 Docs

Drwxr-xr-x. 3 root root 4096 Jan 9 22:26 include

Drwxr-xr-x. 3 root root 4096 Jan 9 22:26 Lib

Drwxr-xr-x. 4 root root 4096 Jan 9 22:26 man

Drwxr-xr-x. Root root 4096 Jan 9 22:26 mysql-test

-rw-r--r--. 1 root root 2496 Sep 19:41 README

Drwxr-xr-x. 2 root root 4096 Jan 9 22:26 scripts

Drwxr-xr-x. Root root 4096 Jan 9 22:26 Share

Drwxr-xr-x. 4 root root 4096 Jan 9 22:26 sql-bench

Drwxr-xr-x. 2 root root 4096 Jan 9 22:26 support-files

6. Initialize the Authorization form

[Email protected] ~]# Cd/usr/local/mysql

[Email protected] mysql]# scripts/mysql_install_db--user=mysql--datadir=/usr/local/mysql/data

7. Edit the configuration file

[Email protected] ~]# CP/USR/LOCAL/MYSQL/SUPPORT-FILES/MY-DEFAULT.CNF/ETC/MY.CNF

[Email protected] ~]# VI/ETC/MY.CNF

---Modify the following content---

Basedir =/usr/local/mysql

DataDir =/usr/local/mysql/data

Port = 3306

8. Mapping MySQL and Mysqladmin directories

[Email protected] ~]# Cd/usr/local/bin

[Email protected] bin]# ln-fs /usr/local/mysql/bin/mysql MySQL

[Email protected] bin]# ln-fs /usr/local/mysql/bin/mysqladmin mysqladmin

# #标红部分为MySQL的实际安装目录, modified according to the actual directory

9. Copy the Mysql.server boot script to the INIT.D directory

[Email protected] ~]# Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysql

10. Start MySQL Servier

[[Email protected] bin]# service MySQL start

11. Modify the root user's password

[Email protected] ~]# mysqladmin-uroot password

12. Connect to MySQL Server

[Email protected] bin]# mysql-u root-p

The end!

2017-08-17

"MySQL" Binary distribution installation

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.