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
During the development and debugging process, it ...
The so-called three-column adaptive layout means ...
Table of contents Drop-down multiple-select box U...
The encapsulation and use of Vue's control pr...
Related Articles: Website Design for User Experien...
Preface Before talking about covering index, we m...
CSS: Copy code The code is as follows: *{margin:0;...
1. Docker installation and settings #Install Cent...
Preface This article mainly introduces the releva...
Background of the problem The server monitoring s...
Using the internal function instr in MySQL can re...
Table of contents 1 Test Environment 1.1 Server H...
Web front-end optimization best practices: conten...
Table of contents Review of Object.defineProperty...
1. Background Sysbench is a stress testing tool t...