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

Practical Optimization of MySQL Paging Limit

Preface When we use query statements, we often ne...

Cross-browser local storage Ⅰ

Original text: http://www.planabc.net/2008/08/05/...

How to resize partitions in CentOS7

Yesterday, I helped someone install a system and ...

Install redis and MySQL on CentOS

1|0MySQL (MariaDB) 1|11. Description MariaDB data...

MySQL database case sensitivity issue

In MySQL, databases correspond to directories wit...

Some experience in building the React Native project framework

React Native is a cross-platform mobile applicati...

How to deploy Solidity smart contracts using ethers.js

If you have developed DApps on Ethereum, you may ...

Detailed explanation of using split command to split Linux files

A few simple Linux commands let you split and rea...

Detailed explanation of CocosCreator optimization DrawCall

Table of contents Preface What is DrawCall How do...

Several common ways to deploy Tomcat projects [tested]

1 / Copy the web project files directly to the we...

Detailed explanation of the use cases of Vue listeners

The first one is to use jQuery's ajax to send...

Exploration and correction of the weird behavior of parseInt() in js

Background: I wonder if you have noticed that if ...

How to install pyenv under Linux

Prerequisites Need to install git Installation St...