Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation of mysql and mysql.sock under linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Recently, when installing Aphace,mysql,php on linux, I encountered a lot of problems. The problems encountered in installing apache and php should be simpler. In Baidu and google, it was solved with a search. Only when installing mysql, I encountered a problem that perplexed me for a long time.

I use ubuntu7.0. When I install mysql, I always make an error when I run mysqladmin version:

Can't connect to local MySQL server through socket 'var/run/mysqld/mysqld.sock'

This makes me almost collapse, I have found a lot of solutions on the Internet, there are probably several solutions:

1. Authority problem

two。 Modify / etc/my.cnf file

3. Operating system or mysql upgrade

4. Create / var/run/mysqld/mysqld.sock

I have tried all the above methods, but none of them solved the problem. I'm about to give up, but I want to hold on a little longer. I'm sure I can solve it. I'm going to send an email to easychen,zoltan. When I'm about to send an email, I wonder if I can change my mind. My idea is: since can't connect to socket'/ var/run/mysqld/mysqld.sock', then when I link to socket, don't I just add the socket parameter at the end?

That is: mysqladmin version-- socket = = / tmp/mysql.sock

I am so glad that the problem has been solved when something unexpected has happened. The problem is solved, but I don't know why, why the default is / var/run/mysqld / mysqld.sock? I checked in the my.cnf file and found that the socket path in both client and mysqld is / tmp/mysql.sock, and the socket specified at compile time is also / tmp/mysql.sock! I really don't understand this point. It seems that I need to look for answers on the Internet. I look forward to more advice from people with knowledge of the matter.

Next, I would like to introduce the liunx mysql.sock problem to you separately.

Error code: Can't connect to local MySQL server through socket'/ var/lib/mysql/mysql.sock'

Mysql.sock is not even in the / var/lib/mysql directory. Your own directory is in / tmp/mysql.sock

So I made a connection.

Ln-s / tmp/mysql.sock / var/lib/mysql/mysql.sock

Just restart it.

Note: ln usage: ln-s source file target file ln command details:

Summary

The above is the problem of installing mysql and mysql.sock under linux introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply you in time. Thank you very much for your support to the website!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report