mysql5.7.12 directly unzip the ZIP package, the installation process

Source: Internet
Author: User
Tags mysql commands

Mysql-5.7.12-winx64.zip Decompression Installation Method

1. Unzip the file to the location you want to install.

I am directly extracted to the e-drive.

2, configure the environment variable, put in path: E:\mysql-5.7.12-winx64\bin;

3, in the E:\mysql-5.7.12-winx64, the new My.ini, MySQL configuration.

The configuration content can be:

---------------------------------------------------------------------------------------------------------

[Client]

port=3306

Default-character-set=utf8

[Mysqld]

port=3306

Character_set_server=utf8

#解压目录

Basedir=e:\mysql-5.7.12-winx64

#解压目录下data目录

Datadir=e:\mysql-5.7.12-winx64\data

Sql_mode=no_engine_substitution,strict_trans_tables

----------------------------------------------------------------------------------------------------------

4. Enter the command window

CD E:\mysql-5.7.12-winx64\bin (if the command can be executed directly, do not need to enter the bin directory)

Command: mysqld--initialize #直接初始化mysql to generate files in the Data folder.

Command: Mysqld-install #安装mysql

Command: net start MySQL #启动服务器

Here are some of the MySQL commands:

#命令: mysqld--console #控制台

Command: net stop MySQL #关闭服务器

Command: Mysqld-remove #卸载mysql

5. Login

At this time with Mysql-uroot-p login, do not know the password, follow the steps to set the password.

1) Edit the MySQL configuration file My.ini (E:\mysql-5.7.12-winx64) and add it under the [Mysqld] entry
Skip-grant-tables
Restart MySQL after saving exit

① Click "Start", "Run" (shortcut key Win+r).

② STOP: Enter net stop MySQL

③ Startup: input net start MySQL

At this time in the cmd input mysql-u root-p can not password login, appear password: When the direct enter can enter.

(1) Enter MySQL database:

mysql> use MySQL;
Database changed

(2) To set a new password for the root user, the blue part of their own input:
Mysql> (version 5.5) update user set Password=password ("New password") where user= "root";

(version 5.7) update user set Authentication_string=password (' 123qwe ') where user= ' root ' and Host = ' localhost ';
Query OK, 1 rows affected (0.01 sec)
Rows matched:1 changed:1 warnings:0

(3) Refresh the database
mysql> flush Privileges;
Query OK, 0 rows Affected (0.00 sec)

(4) Exit MySQL:
Mysql> quit
Bye

After the change, and then modify the My.ini this file, we just joined the "Skip-grant-tables" this line to delete, save the exit and then restart MySQL.

The modification is complete. Restart the MySQL service.

Login: Mysql-uroot-p123qwe

MySQL is ready to connect.

But at this point the operation seems to be incomplete, but also alter user ...

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

This also allows you to:

mysql> set password for ' root ' @ ' localhost ' =password (' 123 ');

And then:

mysql>quit;

Login:

Mysql-uroot-p123 will be able to log in directly.

mysql5.7.12 directly unzip the ZIP package, the installation process

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.