MySQL 5.7 Installation

Source: Internet
Author: User

Linux (CentOS6.7) environment MySQL 5.7.17 installation tutorial share to everyone, for your reference, the specific content as follows:

1 System contract installation file download directory:/data/software mysql directory Installation location:/usr/local/mysql Database save location:/data/mysql Log save location:/data/log/mysql

2 download MySQL in official website: http://dev.mysql.com/downloads/mysql/, select the following version of MySQL download:

Perform the following name: #mkdir/data/software #cd/data/software

--Download the installation package

---Suggest: Use Thunder download on Windows, Fast (my is 1m/s), then use tool (XFTP) to upload to/data/software directory; #wget http://dev.mysql.com/get/Downloads/ Mysql-5.7/mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz

3 Unzip the package to the target location

#cd/data/software

--Unzip the package

#tar-xzvf/data/software/mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz

--Move and modify file names

#mv/data/software/mysql-5.7.17-linux-glibc2.5-x86_64/usr/local/mysql

4 Creating a Data Warehouse Catalog

--/data/mysql Data Warehouse Catalog # Mkdir/data/mysql #ls/data/

5 new MySQL user, group and directory #---Create a new msyql group # useradd-r-s/sbin/nologin-g MySQL mysql-d/usr/local/mysql---new ms YQL User Forbidden Login Shell

6 Change the directory belongs to the person

#cd/usr/local/mysql #pwd #chown-R MySQL. #chgrp-R MySQL.

#chown-R Mysql/data/mysql

7 configuration Parameters # bin/mysqld--initialize--user=mysql--basedir=/usr/local/mysql--datadir=/data/mysql

Note the temporary password generated here, as shown at the end of the:yli>7ecpe; YP #bin/mysql_ssl_rsa_setup--datadir=/data/mysql

8 Modifying the System configuration file

#cd/usr/local/mysql/support-files

# CP MY-DEFAULT.CNF/ETC/MY.CNF # CP Mysql.server/etc/init.d/mysql

# Vim/etc/init.d/mysql

Modify the following content:

9 starting MySQL

#/etc/init.d/mysql Start

--Login

# mysql-hlocalhost-uroot-p

--If it appears:-bash:mysql:command not found

--On execution: # ln-s/usr/local/mysql/bin/mysql/usr/bin--no need to execute without appearing

--Enter the temporary password generated by step 6th

--Change Password

Mysql> set Password=password (' root ');

--Set the host address of the root account (modified to connect remotely)

Mysql>grant all privileges on * * to ' root ' @ '% ' identified by ' root '; Mysql>flush privileges;

--View Table

mysql> use MySQL; Mysql> select Host,user from user;

--You can use the remote connection test here;

10 Add system path # Vim/etc/profile add: Export path=/usr/local/mysql/bin: $PATH as follows:

# Source/etc/profile

11 Configure MySQL autostart # chmod 755/etc/init.d/mysql # chkconfig--add MySQL # chkconfig--level 345 MySQL on

The above is the Linux environment MySQL 5.7.13 installation tutorial, I hope that everyone's learning has helped.

Add:

--Exit the MySQL command window

#exit

--View MySQL status

#service MySQL Status

--Stop MySQL

#service MySQL Stop

--Start MySQL

#service MySQL Start

Attached MY.CNF (this is a configuration MySQL configuration file, temporarily can not tube, as you want to delve into you can Baidu or google "MySQL my.cnf configuration Details")

/ETC/MY.CNF # for advice The change settings "See # Http://dev.mysql.com/doc/refman/5.7/en/server-configuratio n-defaults.html # * * * does not EDIT the this FILE. It's a template which'll be copied to the # * * * * default location during install, and'll be replaced if you # * * * Upgra De to a newer version of MySQL.
[Mysqld]
# Remove Leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of all RAM for dedicated server, else 10%. Innodb_buffer_pool_size = 10G
# Remove Leading # to turn in a very important data integrity Option:logging # Changes to the binary log between backups. Log_bin Character-set-server=utf8 collation-server=utf8_bin init-connect= ' Set NAMES UTF8 ' # These is commonly set, Remov E the # and set as required. Basedir =/usr/local/mysql DataDir =/export/mysql/var Port = 3306 server_id = 22206 Socket =/export/mysql/mysql.sock Bin Log_format = statement # Remove Leading # To set options mainly useful for reporting servers. # The server defaults is faster for transactions and fast selects. # Adjust sizes as needed, experiment to find the optimal values. Join_buffer_size = 128M Sort_buffer_size = 2M Read_rnd_buffer_size = 2M log_bin_trust_function_creators = on Sql_mode=NO_E Ngine_substitution,strict_trans_tables
Lower_case_table_names=1

Document reference: Http://www.cnblogs.com/zhao1949/p/5947938.html

MySQL 5.7 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.