Problems encountered when installing mysql8.0.15 winx64 on Win10 and connecting to the server

Problems encountered when installing mysql8.0.15 winx64 on Win10 and connecting to the server

1. Download, install and configure mysql-8.0.15

1. Download the zip package from the official website (https://dev.mysql.com/downloads/mysql/)

2. Unpack to my D:\mysql directory

3. Configure environment variables for MySQL

Create a new system variable MYSQL_HOME and add the mysql installation directory D:\mysql\mysql-8.0.15-winx64 into it:

Add an environment variable %MYSQL_HOME%\bin to the path (to avoid repeatedly switching paths when operating in the CMD window):

2. Start the mysql service

(At this time, if you are impatient and directly open cmd to start the mysql service, an error will be reported: the service name is invalid. Because mysqld is not installed (d:deamon-daemon))

1. Initialization

Open cmd and run as an administrator (if you do not use the administrator identity, an error will be reported: System error 5 Access denied)

mysqld --initialize-insecure

After the initialization is completed, some files will be automatically generated in the database storage directory (data?), so there is no need to manually create them as some blogs say. If you do not do this initialization step, you will get an error later (unverified, according to a blog post)

2. Install mysqld with administrator privileges:

mysqld -install

3. Start the mysql service with administrator privileges cmd:

net start mysql

4. Use the built-in powershell of Windows to connect to MySQL (because our teacher requires operating MySQL under the shell)

There are two ways to open PowerShell:

① Search for PowerShell as an administrator in the Windows Start bar and open it

② Enter powershell directly in cmd and press Enter

After entering PowerShell, connect and log in to MySQL: mysql -h host -u user -p

host and user represent the host name on which the MySQL server is running and the user name of the MySQL account. -h indicates the server name, -u indicates that the user name root is the default highest-privilege user name, and -p indicates that the password is empty if it is not filled in. I replaced it with my own, but it reported an error of 1130. Why?

Because my account does not allow remote login, only localhost. At this time, just log in to MySQL with administrator privileges on the computer that is localhost, and change the "host" item in the "user" table in the "mysql" database from "localhost" to "%".

mysql -u root -p
mysql>use mysql;
mysql>update user set host = '%' where user = 'root' and host='localhost';
mysql>select host, user from user;

Close (net stop mysql) and restart (net start mysql) the server and you can log in remotely using PowerShell. The connection to the MySQL server is successful as shown below. To disconnect, use quit:

If you are logged in on the same computer running MySQL, you can omit the host and just use the following command:

In addition: When I first logged in to connect to MySQL, I entered the password by simply pressing Enter without entering anything. If you encounter friends who need to enter a password but don’t know the password, you can Baidu it yourself. You can view the initial login password through the file with the suffix .err in the data directory, and you can also log in after changing the password.

Summarize

The above is what I introduced to you about the problems encountered in Win10 installation of mysql8.0.15 winx64 and connecting to the server. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Detailed steps to install mysql 8.0.18-winx64 on win10
  • MySQL 8.0.18 installation and configuration method graphic tutorial under win10 (windows version)
  • Installation and configuration tutorial of MySQL 8.0.16 under Win10
  • MySQL 8.0.15 installation and configuration tutorial under Win10
  • mysql8.0.11 winx64 installation and configuration method graphic tutorial (win10)

<<:  Tutorial on deploying nginx+uwsgi in Django project under Centos8

>>:  How to implement logic reuse with Vue3 composition API

Recommend

3 simple ways to achieve carousel effects with JS

This article shares 3 methods to achieve the spec...

Detailed explanation of the execution order of JavaScript Alert function

Table of contents question analyze solve Replace ...

About uniApp editor WeChat sliding problem

The uniapp applet will have a similar drop-down p...

5 Commands to Use the Calculator in Linux Command Line

Hello everyone, I am Liang Xu. When using Linux, ...

Detailed explanation of JavaScript animation function encapsulation

Table of contents 1. Principle of animation funct...

10 excellent Web UI libraries/frameworks

1. IT Mill Toolkit IT Mill Toolkit is an open sou...

Detailed explanation of the execution process of MySQL query statements

Table of contents 1. Communication method between...

Linux system prohibits remote login command of root account

ps: Here is how to disable remote login of root a...

About the pitfalls of implementing specified encoding in MySQL

Written in front Environment: MySQL 5.7+, MySQL d...

Common shell script commands and related knowledge under Linux

Table of contents 1. Some points to remember 1. V...

Detailed explanation of the implementation of nginx process lock

Table of contents 1. The role of nginx process lo...

Problems and solutions when replacing Oracle with MySQL

Table of contents Migration Tools Application tra...

Tkinter uses js canvas to achieve gradient color

Table of contents 1. Use RGB to represent color 2...