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

What are the simple configurations of mysql8.0

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly introduces "what is the simple configuration of mysql8.0". In daily operation, I believe many people have doubts about the simple configuration of mysql8.0. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the questions of "what is the simple configuration of mysql8.0?" Next, please follow the editor to study!

Some simple configurations for mysql-8.0

download

After downloading, decompress the zip and put it in a directory to configure the environment variables.

Configuration file

After downloading, the downloaded root directory has no my.ini file (or my-default.ini), no my.ini file, so you can create it yourself. Add my.ini under the installation root directory

[mysqld] # set port 3306 port=3306# set mysql installation directory basedir=C:\ Program Files\ mysql-8.0.12-winx64# set the data storage directory of mysql database datadir=D:\ mysql\ data# allow maximum number of connections max_connections=200# allow the number of connection failures. This is to prevent anyone from attempting to attack the character set used by the max_connect_errors=10# server of the database system from this host. By default, the default storage engine default-storage-engine=INNODB# that UTF8character-set-server=utf8# will use when creating a new table uses the "mysql_native_password" plug-in authentication default_authentication_plugin=mysql_native_ password [MySQL] # to set the mysql client default character set default-character-set=utf8 [client] # setting. Set the port port=3306default-character-set=utf8 used by default when the mysql client connects to the server

Note that basedir is my local installation directory, datadir is the location where my database data files are stored, and each configuration needs to be configured according to my own environment.

Initialize the database

Execute the command in the bin directory of the MySQL installation directory:

Mysqld-initialize-console

When the execution is complete, the initial default password of the root user is printed

C:\ Program Files\ mysql-8.0.12-winx64\ bin λ mysqld-- initialize-- console2018-07-28T08:09:39.819831Z 0 [System] [MY-013169] [Server] C:\ Program Files\ mysql-8.0.12-winx64\ bin\ mysqld.exe (mysqld 8.0.12) initializing of server in progress as process 86242018-07-28T08:09:46.120948Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: thbVf 1w7 (Zy2018-07-28T08:09:48.278535Z 0 [System] [MY-013170] [Server] C:\ Program Files\ mysql-8.0.12-winx64\ bin\ mysqld.exe (mysqld 8.0.12) initializing of server has completed

ThbVf;1w7 (Zy is the initial password (without the first space)

If you delete the initialized datadir directory and execute the initialization command again, it will be regenerated.

Installation service

Execute the command in the bin directory of the MySQL installation directory (open the cmd command line as an administrator)

Mysqld-- install [service name]

The following service name can be left unwritten, and the default name is mysql. Of course, if you need to install multiple MySQL services on your computer, you can distinguish them with different names, such as mysql5 and mysql8.

After the installation is complete, you can start the MySQL service with the command net start mysql.

C:\ Program Files\ mysql-8.0.12-winx64\ bin λ mysqld-- installService successfully installed.C:\ Program Files\ mysql-8.0.12-winx64\ bin λ net start mysqlMySQL service is starting. MySQL service has been started successfully.

Change password

Execute the command in the bin directory of the MySQL installation directory: mysql-u root-p

   will be prompted to enter the password. After the initial password is entered, the following code is used to modify the password.

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY' New password

Result

C:\ Program Files\ mysql-8.0.12-winx64\ bin λ mysql- u root-pEnter password: * Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 8Server version: 8.0.12Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'C'to clear the current input statement.mysql > ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY' 123456 questions query OK, 0 rows affected (0.08 sec) mysql > exit, so the study of "what are the simple configurations of mysql8.0" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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