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

Solve the problems encountered in installing mysql-8.0.11-winx64 in Windows environment

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

Share

Shulou(Shulou.com)06/01 Report--

Download the mysql installation package, mine is to download mysql-8.0.11-winx64, extract it to the directory you want to install, and then configure the environment (in window, mac hasn't tried it yet)

1. First, configure the environment: right-click on this computer-> Properties-> Advanced system Settings-> Environment variables-> path- > New, and then add your own path (for example, my directory: F:\ mysql\ mysql-8.0.11-winx64). In addition, you have to see whether there are my.ini files or my-default.ini files in the decompressed package. If you do not need to write one in the root directory The default configuration information is as follows:

To view all configuration items, please refer to: https://dev.mysql.com/doc/refman/8.0/en/mysqld-option-tables.html

[mysqld] # set port 3306 port=3306# set mysql installation directory basedir=F:\ mysql\ mysql-8.0.11-winx64# set the data storage directory of the mysql database (this directory will be generated later without handwriting) datadir=F:\ mysql\ mysql-8.0.11-winx64\ Data# the maximum number of connections max_connections=200# allows the number of connections to fail. 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

2. Then open the terminal, window+r and type cmd to open the terminal and switch to the path, and execute the command mysqld-- initialize to check the current environment. If there are no errors, open your directory and you will see that your root directory will appear the data folder. Everything is fine.

Note that some error messages may be encountered in this step, such as the pop-up "cannot continue to execute the code because the vcruntime140.dll cannot be found, reinstalling the program may solve this problem", indicating that your computer lacks some necessary files. Open the control panel to view C++ 2015 details.

Mine is because there is no x64-bit Clippers before, so the lack of files, if you have, then click uninstall, it will prompt you to repair, click repair, finish, you can continue to enter commands in the terminal

Initialize the database

Mysqld-initialize-console

The following error will be printed at this time, which means that you already have a data directory, just delete it.

F:\ mysql\ mysql-8.0.11-winx64\ bin > mysqld-initialize-console

2018-10-29T09:26:35.244245Z 0 [System] [MY-013169] [Server] F:\ mysql\ mysql-8.0.11-winx64\ bin\ mysqld.exe (mysqld 8.0.11) initializing of server in progress as process 980

2018-10-29T09:26:35.287469Z 0 [ERROR] [MY-010457] [Server]-- initialize specified but the data directory has files in it. Aborting.

2018-10-29T09:26:35.299110Z 0 [ERROR] [MY-010119] [Server] Aborting

2018-10-29T09:26:35.302159Z 0 [System] [MY-010910] [Server] F:\ mysql\ mysql-8.0.11-winx64\ bin\ mysqld.exe: Shutdown complete (mysqld 8.0.11) MySQL Community Server-GPL.

If you execute the above command again, the user's initial password will be printed, where @ localhost: XXXXXX is the default password. You need to remember it. If you don't remember it, delete the later generated data file, and it's OK to generate it again.

F:\ mysql\ mysql-8.0.11-winx64\ bin > mysqld-initialize-console

2018-10-29T09:28:49.177043Z 0 [System] [MY-013169] [Server] F:\ mysql\ mysql-8.0.11-winx64\ bin\ mysqld.exe (mysqld 8.0.11) initializing of server in progress as process 12980

2018-10-29T09:29:19.270535Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: kw3AlnY_g.Dg

2018-10-29T09:29:41.684599Z 0 [System] [MY-013170] [Server] F:\ mysql\ mysql-8.0.11-winx64\ bin\ mysqld.exe (mysqld 8.0.11) initializing of server has completed

3. Then install the service, mysqld-- install [Service name] if there is only one service that does not need to write the default mysql, and if multiple services can write a specific service name, XXXX, and when you enter, an error occurs, install/remove of the service deined. This is because you do not run cmd as an administrator. Just run cmd with the administrator's command again, and the service successfully installed indicates that the service is installed.

F:\ mysql\ mysql-8.0.11-winx64\ bin > mysqld-- installService successfully installed.

4. Start the service, run the command: net start mysql, and see that the service has been started successfully

The F:\ mysql\ mysql-8.0.11-winx64\ bin > net start mysqlMySQL service is starting.... the MySQL service has been started successfully.

5. Change password and password authentication plug-in

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

F:\ mysql\ mysql-8.0.11-winx64\ bin > mysql- u root-pEnter password: * ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

To regenerate the password, delete the data directory, and run mysqld-- initialize-- console.

F:\ mysql\ mysql-8.0.11-winx64\ bin > mysqld-- initialize-- console2018-10-29T10:04:23.337650Z 0 [System] [MY-013169] [Server] F:\ mysql\ mysql-8.0.11-winx64\ bin\ mysqld.exe (mysqld 8.0.11) initializing of server in progress as process 79282018-10-29T10:05:19.210237Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: RXZG 10-29T10:06:00.603070Z 0 [System] [MY-013170] [Server] F:\ mysql\ mysql-8.0.11-winx64\ bin\ mysqld.exe (mysqld 8.0.11) initializing of server has completed

Re-execute mysql-u root-p, fill in the password (note that there is no space around the password), and the relevant information will be printed.

F:\ mysql\ mysql-8.0.11-winx64\ bin > mysql- u root-p

Enter password: *

Welcome to the MySQL monitor. Commands end with; or\ g.

Your MySQL connection id is 8

Server version: 8.0.11

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

Affiliates. Other names may be trademarks of their respective

Owners.

Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.

Change the user's password and execute the command in MySQL: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY' new password;. The following situation proves that you have changed it successfully.

Mysql > ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY' 5502 yulijin. Inquiry OK, 0 rows affected (0.17 sec)

Show databases; ('; 'must be added)

That's it.

Summary

The above is introduced by the editor to solve the problems encountered in the installation of mysql-8.0.11-winx64 in the Windows environment. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to the website!

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