Detailed explanation of mysql download and installation process

Detailed explanation of mysql download and installation process

1: Download MySql

Official website download address: https://dev.mysql.com/downloads/mysql/

Select the corresponding download file. (My computer is 64-bit, so this is the 64-bit download file)

2: Install MySql

Open the downloaded file and unzip it to the specified directory. (My unzip directory is D:\mysql-5.7.21-winx64)

Open the unzipped MySql file and create my.ini (mysql configuration file) in the root directory

The contents of the my.ini file are as follows:
(It is recommended to copy and paste the following file directly)

Here you need to change the basedir and datadir paths to the mysql decompression path

[mysql]

# Set the default character set for the mysql client

default-character-set=utf8

[mysqld]

#Set port 3306

port = 3306

# Set the installation directory of mysql

basedir=D:\mysql-5.7.21-winx64

# Set the storage directory for mysql database data

datadir=D:\mysql-5.7.21-winx64\data

# Maximum number of connections allowed

max_connections=200

# The default character set used by the server is the 8-bit latin1 character set

character-set-server=utf8

# The default storage engine that will be used when creating new tables

default-storage-engine=INNODB

Find the CMD command prompt, right click and run it as administrator

Enter the mysql subdirectory bin

Enter in sequence: mysqld --install (install) mysqld --initialize (initialize) net start mysql (run)

3: Set the MySql login password

As early as several versions ago, the default password of the MySQL root account was not empty. If you log in with an empty password, you will definitely get an error.

Password setting steps:

  1. Add "skip-grant-tables" (cancel permission settings) to the end of the my.ini file and save the file
  2. Restart mysql service
  3. Enter the mysql - bin directory in cmd, enter mysql -u root -p, press Enter, and you can log in without a password.
  4. Reset your password. Type use mysql and press Enter
  5. Enter update user set authentication_string=password("newPassword") where user="root"; (In the new version, the password field of the MySQL database is changed to authentication_string)
  6. Delete the "skip-grant-tables" at the end of the my.ini file and save the file
  7. Restart the mysql service and you can log in to the root account with the new password

Installation Complete

Another way to set MYSQL password.

After MySQL is installed, open the data folder in the MySQL installation directory. There is a .err file in it. Open it with Notepad and you can see the line

A temporary password is generated for root@localhost: xxxxxxxx

localhost: The following is the default password, copy this password to log in,

After a successful login, you must reset your password, otherwise the following error will be displayed.

You must reset your password using ALTER USER statement before executing this statement.

Execute the following command to reset the password and you can use it normally. You can refer to the screenshot below.

SET PASSWORD = PASSWORD('NEW PASSWORD')

The above is a detailed explanation of the MySQL download and installation process introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Solutions to MySQL batch insert and unique index problems
  • Will mysql's in invalidate the index?
  • Detailed explanation of how to migrate a MySQL database to another machine
  • Example of using go xorm to operate mysql
  • Mysql classic high-level/command line operation (quick) (recommended)
  • A brief discussion on the differences between the three major databases: Mysql, SqlServer, and Oracle
  • The use of mysql unique key in query and related issues
  • How to implement scheduled backup of MySQL database
  • Detailed explanation of how a SQL statement is executed in MySQL
  • MySQL slow query optimization: the advantages of limit from theory and practice

<<:  Detailed explanation of publicPath usage in Webpack

>>:  How to resize partitions in CentOS7

Recommend

What we have to say about CSS absolute and relative

Written in the opening: Absolute said: "Rela...

How to configure the Runner container in Docker

1. Create a runner container mk@mk-pc:~/Desktop$ ...

Summary of several implementations of returning to the top in HTML pages

Recently, I need to make a back-to-top button whe...

MySQL slow log online problems and optimization solutions

MySQL slow log is a type of information that MySQ...

Linux system MySQL8.0.19 quick installation and configuration tutorial diagram

Table of contents 1. Environment Introduction 2. ...

How are spaces represented in HTML (what do they mean)?

In web development, you often encounter characters...

MySQL SHOW PROCESSLIST assists in the entire process of troubleshooting

1. SHOW PROCESSLIST command SHOW PROCESSLIST show...

JavaScript implements draggable modal box

This article shares the specific code of JavaScri...

Common problems in implementing the progress bar function of vue Nprogress

NProgress is the progress bar that appears at the...

Teach you to create custom hooks in react

1. What are custom hooks Logic reuse Simply put, ...

React Native JSI implements sample code for RN and native communication

Table of contents What is JSI What is different a...