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)
Tomcat defines multiple ClassLoaders internally s...
1. Introduction When the amount of data in the da...
Table of contents Preface Analysis and solution o...
I recently bought a Tencent Cloud server and buil...
<style type="text/css"> Copy code ...
Recently, the client of a project insisted on hav...
Copy code The code is as follows: <!DOCTYPE ht...
Use Nginx to build Tomcat9 cluster and Redis to r...
1. Download the corresponding installation file f...
For Linux system administrators, it is crucial to...
Today, when I was on the road, a colleague sent m...
my.cnf is the configuration file loaded when MySQ...
Preface Take Element Plus as an example to config...
Table of contents mysql permission control Permis...
This article is translated from the blog Usability...