For Centos installation of MySQL, please refer to a previous article Centos7.3 install Mysql5.7 and change the initial password There are two ways to install MySQL 5.7 on Windows 1. Download the .msi installation file and install it directly according to the interface prompts Here we introduce the second compressed version installation method Official reference document https://dev.mysql.com/doc/refman/5.7/en/windows-install-archive.html 1. Download MySQL Other versions download address https://dev.mysql.com/downloads/mysql/ 2. Install MySQL The compressed package is equivalent to an installation-free file. To use it, you only need to configure the relevant parameters and then start the database service through the service. 2.1 Unzip the compressed file to your preferred location This example is unzipped to the folder D:\software\mysql-5.7.18-winx64 2.2 Create my.ini file Create a my.ini file in the root directory of mysql-5.7.18-winx64 and add the following content: [mysqld] # set basedir to your installation path basedir=D:\\software\\mysql-5.7.18-winx64 # set datadir to the location of your data directory datadir=D:\\software\\mysql-5.7.18-winx64\\data port = 3306 max_allowed_packet = 32M Note that basedir and datadir must be configured. basedir is the directory where you unzipped the files. 2.3 Configure environment variables Add a variable called MYSQL_HOME. 2.4 Initialize database files 1. Run cmd as an administrator and enter the bin directory of mysql. mysqld --initialize After successful initialization, some files will be generated in the datadir directory. Among them, the xxx.err (xxx is the name of your computer user) file describes the temporary password of the root account. Example: <r8j*Qrh)jdp is the temporary password for the root account 2017-05-17T10:31:54.235041Z 1 [Note] A temporary password is generated for root@localhost: <r8j*Qrh)jdp 2.5 Register MySQL service mysqld -install MySQL 2.6 Start MySQL service net start MySQL 3. Change the root password Log in using the root account mysql -u root -p <r8j*Qrh)jdp Change root password ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password'; 4. Installation log Microsoft Windows [Version 6.3.9600] (c) 2013 Microsoft Corporation. All rights reserved. D:\software\mysql-5.7.18-winx64\bin>mysqld --initialize D:\software\mysql-5.7.18-winx64\bin> D:\software\mysql-5.7.18-winx64\bin>mysqld -install MySQL D:\software\mysql-5.7.18-winx64\bin>net start MySQL MySQL service is starting.... The MySQL service has been started successfully. D:\software\mysql-5.7.18-winx64\bin>mysql -uroot -p Enter password: ************ Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.7.18 Copyright (c) 2000, 2017, 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. mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'root'; Query OK, 0 rows affected (0.00 sec) mysql> exit Bye The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: React State state and life cycle implementation method
>>: Docker container deployment attempt - multi-container communication (node+mongoDB+nginx)
Idea imports an existing web project and publishe...
Sometimes we may encounter such a requirement, th...
Don't be surprised if you see some kind of und...
When developing for mobile devices, you often enc...
Effective solution for Ubuntu in virtual machine ...
Table of contents Preface Create a bridge network...
This article example shares the specific code of ...
Some people say that doing advertising is like bei...
Vulnerability Introduction The SigRed vulnerabili...
Use the Linux chmod command to control who can ac...
Preface: Speaking of sandboxes, our minds may ref...
This article shares with you how to use the Vue c...
<br />For an article on a content page, if t...
Copy code The code is as follows: <!DOCTYPE HT...
Recently, when using kazam in Ubuntu 20.04 for re...