Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install mysql5.7.10 in Windows system

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article shows you how to install mysql5.7.10 in the Windows system, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

Install with the MSI installation package

Download the corresponding 32-bit or 64-bit installation package according to your operating system. Follow these steps:

Step 1: double-click the installation file to install the license, check "I accept the license terms" in the interface shown below, and click "next".

Step 2: select the setting type

As shown in the following figure, there are five types of settings:

Developer Default: the tools needed to install the MySQL server and develop MySQL applications. Tools include GUI workbench for developing and managing servers, Excel plug-ins for accessing operational data, plug-ins integrated with Visual Studio, connectors for accessing data through NET/Java/C/C++/OBDC, examples and tutorials, and development documents.

Server only: install only the MySQL server, which is suitable for deploying the MySQL server.

Client only: install only the client, suitable for MySQL application development based on existing MySQL servers.

Full: install all available components of MySQL.

Custom: customize the components that need to be installed.

MySQL will choose the "Developer Default" type by default, and it is personally recommended to choose the pure "Server only" type. By reducing the dependence on tools, you can learn and understand the MySQL database more deeply. You can choose the appropriate type according to your needs. Choose "Server only" here and click "next".

Step 3: install

Go to the interface of the installation step, if the second step is another type and just click "next" to enter the step, click "Execute". As shown in the following figure:

Click "next" after installation until you go to the configuration page.

Step 4: configure

Go to the configuration page, as shown below:

Click the drop-down box of Content Type to show that there are three types:

Development Machine: the development machine, MySQL will take up the least amount of memory.

Server Machine: server machine, several server applications will run on the machine, suitable for database servers as websites or applications, and will consume medium memory.

Dedicated Machine: a dedicated machine that runs the MySQL database server and consumes all the available memory of the machine.

Choose the appropriate type configuration according to your own use. Here I choose the "Server Machine" type for later high concurrency performance testing.

Select the configuration type and configure the connection, as shown below:

TCP/IP connection is commonly used. Check this option box. The default port number is 3306, which can be changed in the input box. If the database is only used locally, check "Open Firewall port for network access" to open the firewall. If you need remote calls, do not check it. The following "Named Pipe" and "Shared Memory" are inter-process communication mechanisms and are generally unchecked. "Show Advanced Options" is used to configure advanced options in subsequent steps to learn as much as possible about the configurable options of MySQL, which is checked here. Click "next" to proceed to the next step.

Step 5: account configuration

Go to the account and role configuration interface of MySQL, as shown below:

The root account has all the permissions of the database. Enter the password you set in the password box. During the development and maintenance of the database, for the sake of security and convenience in managing the account passwords that grant corresponding operation permissions to different users, click the "Add User" button to set accounts with different permission levels in the pop-up session box, as shown in the following figure:

Host represents the host address that can connect to the database and can be set to local (localhost/127.0.0.1), an external IP (such as 218.17.224.228), an external network segment (such as 218.17.224.*), or all hosts (%). Role indicates the role of the account. The optional roles are as follows:

Different roles have different permission levels, which can not be configured for the time being, which will be explained in detail in the chapter on user rights management.

Step 6: configure Windows Service to configure the MySQL service as a Windows service, the MySQL service will automatically start with the startup of the Windows operating system and stop with the stop of the operating system. This is also the configuration recommended by the official MySQL documentation, as shown below:

Windows service Name can be set to the default value, as long as it has a different name from other services. Based on the security requirements in the Windows system, the MySQL service needs to run under a given account, so choose the default Standard System Account. Click "next" after keeping the default configuration.

Step 7: advanced configuration

Because the "Show Advanced Options" option was checked in the previous step 4, the advanced option configuration shown in the following figure appears:

Here you can configure the storage path for various log files, which are stored by default in the data directory of the MySQL installation directory, and are not recommended if not necessary. There is a Seconds configuration item after Slow Query Log (slow query log). The default value is 10, which means that a SQL query will record the query to Slow Query Log after 10 seconds, so that DBA can quickly find inefficient operations. Bin Log can be used for master-slave data synchronization. The bottom Server Id is used for Master-Slave configuration. All of this will be covered in subsequent courses, and you can keep the default configuration here. Click "next".

Step 8: server configuration application

After the above configuration, an MySQL database has been basically configured. After entering this step, click "Execute" to execute the configuration item, as shown below:

Wait until the following interface indicates that the installation is successful, click "Finish" to finish.

Install with a compressed package

Download the corresponding 32-bit or 64-bit compressed package according to your operating system. Follow these steps:

Step 1: decompress

Extract the package to the C:\ Program Files\ MySQL path, or you can customize the path. My path is C:\ Program Files\ MySQL\ mysql-5.7.10-winx64, as shown below:

Step 2: configure environment variables

Right-click "computer", select "Properties", open "Advanced system Settings"-> "Environment variables", select "Path" in the system variables, and click Edit, as shown below:

Leave the original value unchanged, and add C:\ Program Files\ MySQL\ mysql-5.7.10-winx64\ bin at the end of the semicolon to configure the bin directory under the MySQL installation path into the Path variable so that the MySQL command can be executed in any directory on the command line.

Step 3: modify the configuration

Open the my-default.ini file under the MySQL installation directory, find the basedir and datadir property entries, remove the previous comment symbol #, and modify the value as follows: basedir = C:\ Program Files\ MySQL\ mysql-5.7.10-winx64 datadir = C:\ Program Files\ MySQL\ mysql-5.7.10-winx64\ data represents the MySQL installation directory and data directory, respectively. If you extract it to another folder in the first step, modify the corresponding value. Then rename the file to my.ini.

(there is no my-default.ini file in later versions of MySQL5.7.18, so just create a new text file named my.ini. For details, see MySQL website: address 1; address 2)

Step 4: install

Run cmd as an administrator, go to the bin directory of MySQL, and execute the initialization command:

Mysqld-initialize-user=mysql-console

This command is used to initialize data, and it was not necessary to execute it in versions prior to 5.7. After initialization, a temporary root password is provided, which is shown in the red box below. Write down the password.

Then execute the following command to install the MySQL service:

Mysqld-install mysql

Mysql is the default service name, but it is not written. If the installation is successful, you will be prompted as follows:

It is important to note that you must run cmd as an administrator, otherwise you will be prompted as shown in the following figure:

Step 5: start the service

Execute the following command in the administrator cmd window to start the MySQL service:

Net start mysql

When prompted as shown in the following figure, MySQL is installed and started successfully.

Previous versions of MySQL5.7 did not need to execute the mysqld-initialize command in step 4 when installing, and if you omit this command, you will get the following error at this step:

Because of

Some files and folders (such as the data folder) in the archive for this version need to be created after executing the mysqld-initialize command. I suffered a lot here when I used the installation steps of version 5.6 to install, and I hope to take this as a warning and stop stepping in the pit.

Step 6: log in

Execute the following command:

Mysql-uroot-p

Prompt for the password, enter the password recorded in step 4, press enter and the following page appears to indicate that you have successfully logged in and entered the MySQL command line mode.

Step 7: change the password

Execute the following command on the MySQL command line:

ALTER USER 'root'@'localhost' IDENTIFIED BY' new_password'

Change your password to your own password, which indicates that the change is successful as shown in the following figure:

If you execute another SQL command without changing the password, you will get the following error:

The above is how to install mysql5.7.10 in Windows system. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report