MySQL 5.7.12 winx64 Installation configuration method graphics and text tutorial _mysql

Source: Internet
Author: User
Tags change settings flush

Prior to the installation of MySQL did not make a summary, to replace the new computer, fill in the installation record, installation, find some users of the installation records, found a lot of pits

1, Mysql-5.7.12-winx64.zip download
Official Download Address: http://dev.mysql.com/downloads/mysql/

2. Extract to C:\job\mysql-5.7.12-winx64

3. Create a new My.ini configuration file under C:\job\mysql-5.7.12-winx64
the contents are as follows:

################### #配置文件开始 ################### # for advice on ' How to ' change settings, please. # http://dev.mysql.co m/doc/refman/5.7/en/server-configuration-defaults.html # * * * does not EDIT this FILE. It's a template which'll be copied to the # * * * * * * * * * * * * * * * * * * * * location during install, and would be replaced if u

 Pgrade to a newer version of MySQL. [Client] Default-character-set=utf8 [mysqld] port=3306 basedir = "c:\job\mysql-5.7.12-winx64/" DataDir = "C:\jo b\mysql-5.7.12-winx64/data/"Tmpdir =" c:\job\mysql-5.7.12-winx64/data/"socket =" c:\job\mysql-5.7.12-winx64/data/ Mysql.sock "log-error=" c:\job\mysql-5.7.12-winx64/data/mysql_error.log "#server_id = 2 #skip-locking Max_con nections=100 table_open_cache=256 query_cache_size=1m tmp_table_size=32m thread_cache_size=8 innodb_data_h Ome_dir= "c:\job\mysql-5.7.12-winx64/data/" Innodb_flush_log_at_trx_commit =1 innodb_log_buffer_size=128m innodb_ buffer_pool_size=128m innodb_log_file_size=10m innodb_thread_concurrency=16 innodb-autoextend-increment=1000 join_buffer_size = 128M Sort_buffe R_size = 32M Read_rnd_buffer_size = 32M max_allowed_packet = 32M explicit_defaults_for_timestamp=true sql-mode= "ST Rict_trans_tables,no_auto_create_user,no_engine_substitution "Skip-grant-tables #sql_mode =no_engine_substitution
 , Strict_trans_tables ################### #配置文件结束 ###################

The focus is on the following configuration, where DataDir directory name must be: c:\job\mysql-5.7.12-winx64/data/, plus skip-grant-tables, so that root does not lose password, landing

4. In Windows System environment variable path, add the following content
C:\job\mysql-5.7.12-winx64\bin (note plus semicolon)

5, the MySQL registration for Windows system Services
the specific action is to execute the following command on the command line (you need to run the command line as an administrator):

CD C:\Windows\System32
Run as Administrator cmd.exe
need to switch to the bin directory, otherwise the service directory will be specified as C:\job\mysql-5.7.12-winx64\bin

Add Service command: mysqld install MySQL--defaults-file= "C:\job\mysql-5.7.12-winx64\my.ini"

Removal Service command: mysqld remove

6. After the successful 5th step, initialize the data directory
C:\job\mysql-5.7.12-winx64\bin>mysqld--initialize
This step is important, uninitialized, and may cause the MySQL service to fail to start (pit one)

7. Open System service Management
can see the MySQL system service

To start the MySQL command at the command line: net start MySQL

Turn off MySQL command as: net stop MySQL

8, modify the root password
Command line execution:

Mysql–uroot

mysql>show databases;

Mysql>use MySQL;
mysql> Update Mysql.user Set Authentication_string=password (' 12345 ') where user= ' root ' and Host = ' localhost ';

mysql> alter user ' root ' @ ' localhost ' identified by ' 12345 ';

mysql> FLUSH privileges;

Mysql> QUIT

Pit Two: the new version of the MySQL database in the user table has no password field, but the encrypted user password stored in the Authentication_string field

9. Remote Login Configuration
allows the root user to log on remotely from anywhere, with any library operation rights, as follows:

1 login to MySQL with root user on this machine first:

Command-line execution: Mysql-u root-p

Enter password (password set in step 7th): 12345

2) To authorize the operation:

Mysql>grant all privileges in *.* to ' root ' @ '% ' identified by ' 12345 ' with GRANT OPTION;

Overload Authorization Table:

Mysql>flush privileges;

Exit Mysql:quit

Wonderful topic sharing: MySQL different versions of the installation Tutorials mysql5.7 version Installation Tutorials

This is the MySQL 5.7.12winx64 installation configuration method, I hope to help you learn.

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.