Mysql 5.7.11 zip installation and configuration method graphic tutorial, 5.7.11 installation and configuration

Source: Internet
Author: User
Tags change settings dedicated server

Mysql 5.7.11 zip installation and configuration method graphic tutorial, 5.7.11 installation and configuration

1. Download the mysql 5.7.11 zip installation package 

The local computer uses the win7 64-bit system as an example. If it is a 32-bit system, download the 32-bit installation package.

Http://dev.mysql.com/downloads/mysql/

Select Windows (x86, 64-bit) and ZIP Archive to download the package

Ii. Unzip the installation package| Extracting the Install Archive

D: \ victor. min \ software \ mysql-5.7.11-winx64 # My unzipping directory

3. Create an empty folder named data,You can also name it as needed to store data.

# The local machine is created in the D: \ victor. min \ software \ mysql-5.7.11-winx64 directory, so the end will see D: \ victor. min \ software \ mysql-5.7.11-winx64 \ data # This folder will be used later

4. configure a STARTUP configuration file| Creating an Option File

If you have nothing special to use, set D: \ victor. min \ software \ mysql-5.7.11-winx64 \ my-default.ini file copy, renamed my. ini. Modify the parameters. | the configuration file is as follows:

# For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html# *** do not edit this file. it's a template which will be copied to the # *** default location during install, and will be replaced if you # *** upgrade 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 total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128 M # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # These are commonly set, remove the # and set as required. # basedir = ..... # datadir = ..... # port = ..... # server_id = ..... ########################## basedir is the directory after the installation file is decompressed | basedir and datadir can be used relative Path # basedir =. /.. basedir = D :\\ victor. min \ software \ mysql-5.7.11-winx64 # datadir is the directory used to store data # datadir =. /.. /datadatadir = D: \ victor. min \ software \ mysql-5.7.11-winx64 \ data # port is port = 3306 # mar_connections is the maximum number of connections max_connections = 20character_set_server = utf8 # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128 M # sort_buffer_size = 2 M # read_rnd_buffer_size = 2 M accept = truesql_mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES

V. initialize the data directoryInitializing the Data Directory

Of course, according to the steps given in the mysql official documentation, there is also a step to Selecting a MySQL Server Type, that is, choose mysqld or mysqld-debug | the command is as follows

mysqld --defaults-file="D:\victor.min\software\mysql-5.7.11-winx64\my.ini" --initialize-insecure

Note:

1. This command is very important. It will initialize the data directory. Before executing this command, delete all files in the data directory first. Otherwise, it will fail.

2. You can choose to use -- initialize-insecure or -- initialize for initialization, and -- initialize-insecure for initialization. the root password is blank. If you use -- initialize for initialization, a random password will be generated.

After the execution is successful, you will see the mysql, perofrmance_schema, and sys directories in the data directory, and there will also be some files

Vi. Install the mysql Service

mysqld -install

7. Start the mysql Service

net start mysql 

Here, the mysql service is started, and we can use root to access mysql.

mysql -u root -p

For convenience, it is best to configure mysql to Environment Variables

Postscript:

If any steps fail, run the mysql remove command to delete all the files in the data directory.

mysqld -remove 

Note: 5.7 and 5.6 are not the same. You must initialize the data directory on your own. Otherwise, the startup will not succeed.

Statements that may be used after mysql Installation

alter user 'root'@'localhost' identified by '123';create database victor;create user 'victor'@'localhost' identified by 'victor@123';flush privileges;creaet user 'victorremote'@'%' identified by 'victorremote@123';flush privileges;grant all on victor.* to 'victor'@'localhost' identified by 'victor@123';flush privileges;grant all on victor.* to 'victorremote'@'%' identified by 'victorremote@123';flush privileges;################################
show variables like 'collation_%';
show variables like 'character_set_%';
set collation_connection=utf8_general_ci;
set character_set_client=utf8;
set character_set_connection=utf8;
set character_set_results=utf8;

Mysql configuration parameter query

Http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

Related Article

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.