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
As a powerful editor with rich options, Vim is lo...
Table of contents 1. Document.execCommand() metho...
Sometimes, while working with files in the Linux ...
In fact, we wonder every day when IE6 will really...
When a running container is terminated, how can w...
This article shares the tutorial of MySql install...
Some web pages may not look large but may be very ...
Table of contents Select Structure Loop Structure...
Table of contents Preface 1. Current gcc version ...
Table of contents 1. Constructors and prototypes ...
Table of contents 1. Project folder structure 1. ...
Due to business needs, there are often rush purch...
Reminder: Whether it is planning, designing, or de...
Preface Engineers working in the Linux environmen...
Table of contents Written in front 1. Ngixn image...