After the Windows system Navicat Lite for MySQL is installed, the bin directory cannot be found, and the client cannot be connected by typing mysql -u root -p

Table of contents

1. Problem description

        Use the server to back up data, win+r input cmd to open a black window, input mysql -u root -p cannot achieve client connection

2. Solve the problem

        Question 1: Find the file path of the bin directory of mysql

        Question 2: Configure environment variables

1. Problem description

        Use the server to back up data, win+r input cmd to open a black window, input mysql -u root -p cannot achieve client connection

 After searching the reason online, I learned that after installing MySQL, you need to configure environment variables, but the prerequisite for configuring environment variables is to know the path of the bin directory file of mysql. After finding the path configuration, you can connect to MySQL in any directory.

2. Solve the problem

        Question 1: Find the file path of the bin directory of mysql

a. Right-click This PC, click Manage

b. Click on Services and Applications

 c. Click Service

 d. After finding the MYSQL service, click

 f. Copy the path of the executable file (note: only need to copy to the bin file)

        Question 2: Configure environment variables

a. Click Settings

 b. Click System

 c. Click About

 d. Click Advanced System Settings

e. Click Environment Variables

 

f. Click Path

g. Add the bin directory of mysql just found in it, click OK after adding, and click OK in the above windows to save the updated environment variables

h. After opening the black window, try to connect to the client again. After entering the password, the connection is successful, and the problem is solved.

 

 

Guess you like

Origin blog.csdn.net/weixin_50576361/article/details/132026731