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 configure my.ini in versions above mysql5.7

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly introduces the above version of mysql5.7 how to configure my.ini, the article is very detailed, has a certain reference value, interested friends must read it!

There is no data directory and my-default.ini and my.ini files in the package of Windows 64-bit mysql version 5.7 and above, as well as the solution that the service cannot be started and the method to change the initial password.

Take version 5.7.20 as an example

After installing the package and decompressing it first, there is no data folder and my-default.ini mentioned in the online tutorial, as shown in the following figure

Please refer to the online tutorials for configuring environment variables. There is generally no problem with this, that is, add the path where the MYSQL package bin is located in the environment variable Path. Mine is:

D:\ softnew\ MYSQL\ mysql-5.7.20-winx64\ bin

Mainly pay attention to the following points:

(1) it doesn't matter whether the my-default.ini file exists. You need to create a new my.ini file in the root directory. The details are as follows:

[mysql] # set mysql client default character set default-character-set=utf8 [mysqld] # set port 3306 port = 3306 # set mysql installation directory basedir=D:\\ softnew\\ MYSQL\\ mysql-5.7.20-winx64# allow maximum number of connections the character set used by the max_connections=200# server defaults to 8-bit encoded latin1 character set character-set-server=utf8# the default storage engine default-storage-engine=INNODB to use when creating a new table

You can copy and paste directly. You can mainly modify the path after basedir. Note that the path is\\ instead of\.

(2) Please do not create your own data folder

Many tutorials on the Internet suggest creating an empty data folder and adding a sentence to the my.ini file:

# set the data storage directory of mysql database datadir=D:\\ softnew\\ MYSQL\\ mysql-5.7.20-winx64\\ data

This will cause the service to fail to start. Do not add this sentence or create a new data folder yourself. Just let mysql generate the data automatically. Specifically:

1) Open the cmd command window as an administrator (if you directly open cmd to run, you may get an error), and go to the bin directory of the mysql installation directory. Then enter the command mysqld install to display successfully

2) re-enter: mysqld-initialize should not have any prompt at this time

3) re-enter: net start mysql display

Finally, the contents of the data folder should be displayed as follows:

Note: when you log in to MYSQL for the first time, you will be prompted to enter the initial password, which is for security considerations. The command: mysqld-initialize will randomly generate the password.

The initial password is in the xxx.err file under the data folder above. You can open it in notepad and use the ctrl+f lookup function to find the following line of records:

[Note] A temporary password is generated for root@localhost: NZ+uhXPq1zN.

Among them NZ+uhXPq1zN. That is, the initial password (note. Don't miss the number.)

After entering, you can modify it with the following command, where the password is changed to root:

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

Here is version 5.7.22, which is basically shown as follows:

The above is all the contents of the article "how to configure my.ini above mysql5.7". Thank you for reading! Hope to share the content to help you, more related knowledge, 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