The following is divided into four steps to introduce how to install and start MySQL under Windows, please see below for details.
The first step: Download the MySQL installation package or green version, put it in your favorite directory.
Step Two: Configure environment variables. Mysql_home, the value is the root directory of MYSQL; add%mysql_home%/bin directory in path.
Step three: Register the MySQL service with Windows. You must open the command line with administrator privileges, and then switch to the MySQL bin directory and enter the command: Mysqld.exe--install MySql--defaults-file= "D:/mysql/my-default.ini", "d:/ Mysql/my-default.ini "changed to its own MySQL installation directory.
Fourth step: Start the MySQL service. At the command line input: net start MySQL, success will prompt: MySQL service has started successfully.
Problem: MySQL database in the user table, there is a username empty account that is anonymous account, resulting in the login is although the use of root, but is actually anonymous login, through the error prompted in the ' @ ' localhost ' can be seen. This causes operations such as data tables to be created without permissions.
Resolve: The user logs on after shutting down and logging off the service, performing the following actions.
1, cmd mode into the bin directory of MySQL, input d:/mysql/bin>mysqld--defaults-file= "D:/mysql/my-default.ini"--console- Skip-grant-tables, carriage return, this command line hangs.
2. Open a separate command line, also cut to the MySQL bin directory, d:/mysql/bin>mysql-u root MySQL, enter
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL connection ID is 1
server version:5.6.20 mysql Community server (GPL)
Mysql>
Connected to the MySQL database, you can enter the MySQL command.
3, set the password
mysql> Update user Set Password=password (' 123456 ') where user= ' root ';
Query OK, 2 rows affected (0.02 sec)
rows matched:3 changed:2 warnings:0 mysql> FLUSH
;
Mysql> quit
The above content is this article gives everybody to share the Windows how installs and launches the MySQL, hoped everybody likes.