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

Mysql date formatting and complex date range query

Table of contents Preface Query usage scenario ca...

JavaScript implements draggable modal box

This article shares the specific code of JavaScri...

Methods and techniques for quickly displaying web page images

1. Use .gifs rather than .jpgs. GIFs are smaller ...

Methods to enhance access control security in Linux kernel

background Some time ago, our project team was he...

A complete list of commonly used HTML tags and their characteristics

First of all, you need to know some characteristi...

Stop using absolute equality operators everywhere in JS

Table of contents Overview 1. Test for null value...

mysql uses stored procedures to implement tree node acquisition method

As shown in the figure: Table Data For such a tre...

Three ways to implement virtual hosts under Linux7

1. Same IP address, different port numbers Virtua...

Ways to improve MongoDB performance

MongoDB is a high-performance database, but in th...

HTML Frameset Example Code

This article introduces a framework made by Frame...

Implementation code of using select to select elements in Vue+Openlayer

Effect picture: Implementation code: <template...