Install and configure MYSQL 5.7.11 without installation: solve the problem that MYSQL cannot be started.

Source: Internet
Author: User
Tags mysql official site

Install and configure MYSQL 5.7.11 without installation: solve the problem that MYSQL cannot be started.

Download MySQL5.7.11 ZIP Archive on http://dev.mysql.com/downloads/mysql official site:


Download 32-bit or 64-bit data from your computer

Decompress the package to a directory. Here is the C: root directory:


Open the folder, modify a copy of The my-default.ini, and rename it my. ini

Copy the following configuration information to my. ini and save it.
######################################## #################
[Client]
Port = 3306
Default-character-set = gbk
[Mysqld]
Port = 3306
Character_set_server = gbk
Basedir = C: \ mysql-5.7.11-winx64
# Decompress the Directory
Datadir = C: \ mysql-5.7.11-winx64 \ data
# Decompress the data directory in the directory
SQL _mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES
[WinMySQLAdmin]
C: \ mysql-5.7.11-winx64 \ bin \ mysqld.exe
######################################## #################

Then modify the environment variable:

1) Right-click my computer-> properties-> advanced system settings (advanced)-> Environment Variables
Click New under "system variables"
Input variable name: MYSQL_HOME
Input variable value: C: \ mysql-5.7.11-winx64
# This is the custom extract directory of mysql.
2) select Path in "system variables"
Click Edit
Add the variable value % MYSQL_HOME % \ bin to the variable value.
Note that this variable is added after the original variable value and separated by;. The original variable value cannot be deleted,

Click the start icon and Enter cmd in the search box. Right-click the cmd program and choose run as administrator.


Note !!! The following is different from the previous version 5.6 Installation Process !!!!!!!

Initialize the Data DIRECTORY first: the Data directory is included in earlier versions 5.6. This step is not required! If this step is not completed, the mysql service cannot be started.

Enter the following command in the CMD window:

Mysqld -- initialize-insecure

This process is slow. Wait a while.


The data directory is displayed as follows:


Then start the installation in CMD and enter the following command:

Mysqld install

Start the service and enter the following command:

Net start mysql

Note: mysqld remove is used to remove installation; mysqld -- initialize-insecure is used to automatically generate root users without passwords; mysqld -- initialize is used to automatically generate random password users;

Then you can log on.

Mysql-u root-p

Enter


Modify the password of the root account

The MySQL statement ends with a semicolon (;). If a semicolon (;) is not added at the end of the statement, the command prompt will prompt you to continue to input (in some special cases, but the bonus points are certainly not wrong); When the installation is complete, the default password of the root account is blank. At this time, you can change the password to the specified password. Example: 123456
C:> mysql-uroot
Mysql> show databases;
Mysql> use mysql;
Mysql> UPDATE user SET password = PASSWORD ("123456") WHERE user = "root ';
Mysql> flush privileges;
Mysql> QUIT

Use the view management tool Navicat Premium to connect to the database:


When there is a network connection, the host name can be "localhost". If there is no network connection, set it to "127.0.0.1 ":


VcDvw + a1xMr9vt2/4sHLo7o8L3A + CjxwPjxpbWcgc3JjPQ = "http://www.2cto.com/uploadfile/Collfiles/20160413/2016041309022524.jpg" alt = "">

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.