After installing TiDB, unable to log in to the client locally

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tidb安装好之后本地不能登陆客户端可以

| username: 舞动梦灵

As shown in the picture, local login keeps prompting that no password is used. However, I can log in using the Navicat client. This is a newly installed environment. I don’t know where the problem is. When I install a set on another computer’s virtual machine, I can log in locally.

| username: 大飞哥online | Original post link

Change the IP to 127.0.0.1.

| username: 普罗米修斯 | Original post link

show grants for root to check the permissions

| username: 啦啦啦啦啦 | Original post link

select user,host from mysql.user to have a look

| username: zhanggame1 | Original post link

The picture doesn’t show a local login either. Obviously, you entered the wrong password.

| username: 舞动梦灵 | Original post link

I am logging into the server at 192.168.81.131, and the password is 123456. It is impossible to enter it incorrectly; both manual input and pasting do not work.

| username: 舞动梦灵 | Original post link

This server is a home computer. I’ll have someone turn on the home computer and then I’ll check it out.

| username: zhanggame1 | Original post link

The password might not be 123456.

| username: Fly-bird | Original post link

The password is incorrect.

| username: 啦啦啦啦啦 | Original post link

It shouldn’t be a password error, otherwise it should say “using password: yes”. Check which users are available, it might be an account error.

| username: ti-tiger | Original post link

It feels like either the user made a mistake, or the wrong IP was connected.

| username: 舞动梦灵 | Original post link

You can log in using other servers.

| username: 舞动梦灵 | Original post link

The IP is correct.

| username: 舞动梦灵 | Original post link

127.0.0.1 doesn’t work either

| username: 舞动梦灵 | Original post link

The permissions seem fine.


This is from another test server.
image

| username: 啦啦啦啦啦 | Original post link

Try writing the plaintext password after -p, does it still report this error?

| username: xingzhenxiang | Original post link

Try plaintext password.

| username: hey-hoho | Original post link

It feels like the password wasn’t entered.

| username: 舞动梦灵 | Original post link

It’s the same.

| username: xingzhenxiang | Original post link

Try putting the -p option at the end of the command line,
mysql -uroot -P4000 -h192.168.81.131 -p123456
The error you encountered is because the -p option was not recognized at all, as shown in the image.