Recently, when I was using Linux to log in locally, I found that I could not log in normally and reported the following error message:
Analysis: Using mysql --verbose --help for analysis, it was found that the values corresponding to port and socket were 0 or empty, that is, there were no default parameters. [root@UHDEV013 ~]# mysql --verbose --help |grep socket --protocol=name The protocol to use for connection (tcp, socket, pipe, -S, --socket=name The socket file to use for connection. The buffer size for TCP/IP and socket communication. socket [root@xxxxx ~]# mysql --verbose --help |grep port -P, --port=# Port number to use for connection or 0 for default to, in port 0 When logging in to MySQL, you need to find the relevant parameters from the configuration file before you can get the default parameters. The location of the parameter file is as follows: I don't know why the parameters added directly using -P on the command line are not used. [root@UHDEV013 ~]# mysql --verbose --help |grep my.cnf order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/my.cnf /etc/mysql/my.cnf /usr/haier/mysql/etc/my.cnf /usr/haier/mysql/my.cnf ~/.my.cnf Solution: In the /etc/my.cnf file, just add the socket parameter in [client]. Adding only the port parameter will not work. The reason is currently unclear. Summarize The above is the solution to the problem that MySQL local login cannot use the port number to log in. I hope it will be helpful to everyone. 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:
|
>>: Detailed explanation of Vue ElementUI manually uploading excel files to the server
Preface Take Element Plus as an example to config...
Open the scheduled task editor. Cent uses vim to ...
This article uses examples to describe advanced u...
1) Process 2) FSImage and Edits Nodenode is the b...
In my previous article, I said that the optimizat...
The installation tutorial of mysql 8.0.11 winx64 ...
Table of contents 1. Description 2. Installation ...
Redis uses the apline (Alps) image of Redis versi...
Table of contents background Importing virtual fi...
Preface: In some previous articles, we often see ...
Table of contents 1. Introduction to priority que...
1. Radio grouping As long as the name is the same,...
Table of contents 1. Container service update and...
This article example shares the specific code of ...
MySQL 5.7 MySQL command line client using command...