Mysql5.7.13 environment building tutorial (decompressed version), mysql5.7.13 build

Source: Internet
Author: User
Tags change settings dedicated server

Mysql5.7.13 environment building tutorial (decompressed version), mysql5.7.13 build

I recently decided to study the database. After comparing each database, I chose to start with mysql. The main reason is:
• Open Source
• Mature and General
• A large number of users and a complete community
• Easy to get started

1. Download and install
Mysql Official Website: http://dev.mysql.com/downloads/mysql/
The mysql official website has two versions available for Download: The Client Version (Recommended Download, also the Recommended version on the official website) and the decompressed version (Archive ). Click download to download the decompressed version. After the download is complete, decompress the package directly to the target path where you want to install mysql.
I downloaded version 5.7.13, decompress it, and get a mysql-5.7.13-winx64 folder that contains the following files:
<DIR>.
<DIR> ..
2016/07/18 14:34 <DIR> bin
17,987 COPYING
<DIR> docs
2016/07/18 14:33 <DIR> include
2016/07/18 14:34 <DIR> lib
1,141 my-default.ini
2,478 README
<DIR> share
3 files in 21,606 bytes
118,994,726,912 bytes available for 7 Directories
Download and install

Ii. Configure mysql 

1. Configure my. ini
Here I rename the mysql-5.7.13-winx64 file to mysql (the original file name is too long), The my-default.ini under this file is the default configuration file, we need to re-configure it ourselves here: copy the my-default.ini and rename it to my. ini, and replace the file directory of parameters such as basedir and datadir with the path of your mysql directory.

 # 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 = 128M# 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 = C:\mysqldatadir = C:\mysql\data# port = .....# server_id = .....# 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 = 128M# sort_buffer_size = 2M# read_rnd_buffer_size = 2Msql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

I put the mysql file on drive c, so I just need to fill in the "c:/mysql" in the above file with your own file path.

2. Configure Environment Variables
Adding the PATH of your mysql bin folder to PATH is simple.

Iii. Run mysql
Run cmd as an administrator (Be sure to run it as an administrator) and enter the binfile of mysql.
Mysqld -- remove
Mysqld -- install
Mysqld -- initialize // a data folder is generated.
Net start mysql // start the mysql Service
After executing these three commands in turn, open the data folder and find the file with the error file type under it. This file is the log of mysql initialization, including the initialization password. If "root @ localhost is created with an empty password!" is displayed !", It is null. Then execute
Mysql-uroot-p
Enter the user name and password, and "Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement." indicates that the connection is successful.

Iv. logon Error
 
If there is a problem during login, "Access denied for user 'root' @ 'localhost'" is displayed, you can try to reset the root password:
1. Modify the/my. ini file, add skip-grant-tables under [mysqld], and then start mysql.

2. log on to MySQL as a root user using an empty password;
Mysql-u root

3. Modify the password of the root user;

Mysql> update mysql. user set password = PASSWORD ('new password') where User = 'root' mysql> flush privileges; mysql> quit

4. Restart MySQL to log on with the new password.

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

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.