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

How to change the host name in Linux

1. View the current host name [root@fangjian ~]# ...

Detailed explanation of using Vue.prototype in Vue

Table of contents 1. Basic Example 2. Set the sco...

mysql5.5.28 installation tutorial is super detailed!

mysql5.5.28 installation tutorial for your refere...

MySQL series multi-table join query 92 and 99 syntax examples detailed tutorial

Table of contents 1. Cartesian product phenomenon...

How to detect file system integrity based on AIDE in Linux

1. AIDE AIDE (Advanced Intrusion Detection Enviro...

Linux MySQL root password forgotten solution

When using the MySQL database, if you have not lo...

Understanding v-bind in vue

Table of contents 1. Analysis of key source code ...

jQuery to achieve the barrage effect case

This article shares the specific code of jQuery t...

css3 animation ball rolling js control animation pause

CSS3 can create animations, which can replace man...

How to use MySQL common functions to process JSON

Official documentation: JSON Functions Name Descr...

In-depth explanation of MySQL learning engine, explain and permissions

engine Introduction Innodb engine The Innodb engi...