1. Download, install and configure mysql-8.0.151. 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) 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: 3. Start the mysql service with administrator privileges cmd: 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: 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! You may also be interested in:
|
<<: Tutorial on deploying nginx+uwsgi in Django project under Centos8
>>: How to implement logic reuse with Vue3 composition API
This article shares 3 methods to achieve the spec...
Table of contents question analyze solve Replace ...
The uniapp applet will have a similar drop-down p...
Hello everyone, I am Liang Xu. When using Linux, ...
Origin of the problem When using docker, I unfort...
Table of contents 1. Principle of animation funct...
1. IT Mill Toolkit IT Mill Toolkit is an open sou...
It was found in the test that when the page defini...
Table of contents 1. Communication method between...
ps: Here is how to disable remote login of root a...
Written in front Environment: MySQL 5.7+, MySQL d...
Table of contents 1. Some points to remember 1. V...
Table of contents 1. The role of nginx process lo...
Table of contents Migration Tools Application tra...
Table of contents 1. Use RGB to represent color 2...