1. Download the MySQL installation package to the specified file:
For example, I extracted the contents of the downloaded MySQL zip into this file, the specific file content is as follows:
My.ini needs to create its own, the contents are as follows:
==3306sql_mode
The important point here is that you need to create my.ini; So that we have completed the first step of the foundation.
2. Start the requirement setting:
That is, it needs to be executed in the CMD command line in the MySQL directory:
Mysqld--defaults-file=my.ini--initialize-insecure
Mysqld--install
This 2-part bash language performs the basic setup.
3. Finally, start MySQL:
net start MySQL
The execution of all the base here needs to be performed under the Administrator's authority, otherwise there is no permission to execute the command.
Finally, MySQL was successfully launched.
4. Modify the MySQL root password:
Method 1: Use the Set password command
First log in to MySQL.
Format:mysql> set password for user name @localhost = password (' new password ');
Example:mysql> set password for [email protected] = password (' 123 ');
Method 2: Use Mysqladmin
Format: Mysqladmin-u username-P Old password password new password
Example: mysqladmin-uroot-p123456 password 123
Method 3: Edit the user table directly with update
First log in to MySQL.
mysql> use MySQL;
mysql> Update user set Password=password (' 123 ') where user= ' root ' and host= ' localhost ';
mysql> flush Privileges;
So basically we have successfully installed and started MySQL configuration.
Attached: You may encounter a problem:
My solution is to reinstall it, or if you haven't quit MySQL after installation:
Execute the following statement:
Mysql>update User Set host = '% ' where user = ' root ';
See this article specifically: http://www.111cn.net/database/mysql/42040.htm
Window installation MySQL Tutorial