How to install and start Mysql_mysql under Windows

Source: Internet
Author: User

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.

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.