How to add MySQL to system service in Windows (mysql decompress version) _ MySQL

Source: Internet
Author: User
This article mainly introduces how to add MySQL to the system service in a Windows system, mainly for the mysql decompress version. if you are interested, refer to MySQL software version: 64-bit 5.7.12.

1. first configure the MySQL environment variable, add the bin directory Path of MySQL at the beginning of the system environment variable Path, and end with ";". The Path configuration is as follows:

2. modify the contents of the my-default.ini file under the MySQL root directory; mainly modify two attributes: basedir and datadir.

Basedir: root directory of MySQL;

Datadir: Directory for storing database data (the directory must be manually created );

Notes:

It is best to use a backslash to slash the Directory, without escaping or adding double quotation marks;

The datadir directory must be created in advance.

3. use the system administrator to start CMD (command prompt) and enter the bin directory of MySQL (this step is required even if the Path is configured !); For example:

  

4. to install the MySQL service, enter the command mysqld-install and press Enter. the following prompt indicates that the installation is successful:

-The install command can also specify the address of the configuration file, as follows: mysqld-install MySQL -- defaults-file = "D: \ software \ mysql5.7.12 \ my-default.ini"

5. initialize the MySQL service and enter the command mysqld -- initialize.

We recommend that you clear the datadir directory before executing this command. otherwise, Initialization may fail.

For example, the system prompts 3534 error

6. start the MySQL service and enter the command: net start mysql. the startup is successful, for example:

Other common commands:

1. stop the MySQL service and enter the command: net stop mysql

2. remove the MySQL service and enter the command mysqld-remove.

The above section describes how to add MySQL to the system service (mysql decompress version) _ MySQL in Windows. For more information, see PHP Chinese website (www.php1.cn )!

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.