Mysql-5.7.12-winx64 Configuration documentation Hou Zhiyu due to document pictures are not convenient to upload, so the reference in the document pictures are not uploaded up, if you need to go to my documents to download this document; recently I am studying JAVA Development and need to use the mysql database. So I set up a specific database environment.
Mysql-5.7.12-winx64 Configuration documentation Hou Zhiyu due to document pictures are not convenient to upload, so the reference in the document pictures are not uploaded up, if you need to go to my documents to download this document; recently I am studying JAVA Development and need to use the mysql database. So I set up a specific database environment.
Mysql-5.7.12-winx64 Configuration documentation
Hou Zhiyu
Because document images are not easy to upload, none of the images referenced in the document are uploaded. If necessary, you can download this document from my documents;
Recently I am studying JAVA Development and need to use the mysql database. So I set up a database environment myself.
The procedure is as follows:
1. Download MySQL from http://dev.mysql.com/downloads/mysql/5.7.html( you need to register a user)
I downloadedWindows (x86, 64-bit), ZIP Archive(Mysql-5.7.12-winx64.zip)
2. After the download is complete, decompress the file to the directory to be executed. The decompressed file directory is as follows:
3. Create my. ini configuration file in the current directory to replace the my-default.ini File
The configuration file content is as follows: basedir and datadir are the current mysql path
[Mysql] # Set the default Character Set of the mysql client Default-character-set = utf8 [Mysqld] # Set port 3306 Port = 3306 # Set the installation directory of mysql Basedir = C :\mysql \ mysql-5.7.12-winx64 # Set the directory for storing mysql database data Datadir = C: \ mysql \ mysql-5.7.12-winx64 \ data # Maximum number of connections allowed Max_connections = 200 # The default character set used by the server is the 8-bit latin1 character set. Character-set-server = utf8 # The default storage engine used to create a new table Default-storage-engine = INNODB |
4. in earlier versions, mysql has a data folder, which needs to be automatically generated in the new one. Run the following command:
C: \ mysql \ mysql-5.7.12-winx64 \ bin> mysqld -- initialize
The final directory is as follows:
5. Start the Mysql service in the service. You can start the Mysql service at this time (if there is no data file, the service cannot be started)
6. The following figure shows how to change the mysql database login password (this method is different from the old version)
7. When I started running the input skip-grant-tables system, the system always prompts an error, so I changed the method to handle it.
Stop the service first, add the skip-grant-tables command in my. ini, and restart the my. ini service.
8. Enter C: \ mysql \ mysql-5.7.12-winx64 \ bin> mysql-uroot-p in CMD without entering the password
Execute SQL to Change Password
Mysql> alter user 'root' @ 'localhost' identified by '20140901 '; You can also: Mysql> alter user 'root' @ 'localhost' identified by '20140901 '; |
* Note that the encrypted user Password is stored in the authentication_string field instead of the Password field in the user table of the new mysql database.
9. After modification, restart
Mysql> flush privileges;
Mysql> quit;
10. Delete the skip-grant-tables command in my. ini and restart the Mysql service.
11. The following code can be used normally;
Refer to the blog (thanks to the blogger ):
Http://www.jb51.net/article/77858.htm
Http://blog.sina.com.cn/s/blog_74f1badb0100ufbx.html