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
1. Introduction When the amount of data in the da...
1. View the current host name [root@fangjian ~]# ...
When using <a href="" onclick="&...
When looking at High Performance MySQL Version 3 ...
Table of contents 1. Basic Example 2. Set the sco...
mysql5.5.28 installation tutorial for your refere...
Table of contents 1. Cartesian product phenomenon...
1. AIDE AIDE (Advanced Intrusion Detection Enviro...
When using the MySQL database, if you have not lo...
Table of contents 1. Analysis of key source code ...
This article shares the specific code of jQuery t...
CSS3 can create animations, which can replace man...
In actual development, the primary key of MySQL c...
Official documentation: JSON Functions Name Descr...
engine Introduction Innodb engine The Innodb engi...