English 中文(简体)
无法通过 sock /var/run/mysqld/mysqld.sock (2) [关闭] 连接到本地 MySQL 服务器
原标题:Can t connect to local MySQL server through socket /var/run/mysqld/mysqld.sock (2) [closed]
Closed. This question is off-topic. It is not currently accepting answers.

想要改进这个问题吗? 更新了问题 ,因此堆积溢流的回答是

Closed 11 years ago.

I am a newbie programmer, so I will need your help! Locally the webapp works ok with the db on it! When I uploaded the application on the cloudcontrol, it comes up with the following error:

CDb连结无法打开 DB 连接: SQLSTATE[HY000] [2002] 无法通过套接字/ var/run/mysqld/mysqld.sock 连接到本地 MySQL 服务器(2)!

我想我还没有上传 db 。 这是我第一次在服务器上上上传 Webapp, 所以我不知道在服务器上上上传 db 需要遵循什么步骤。 Cloudcontrol 有关于 Mysql 的文档! 我确实遵循了这些步骤, 但网络应用程序也有同样的错误!

请告诉我,为了使之发挥作用,我必须遵循什么步骤?我确信,这一错误是由于缺乏知识造成的!

问题回答

SQL 服务器很可能位于一个单独的机器上,您需要通过主机名或 IP 地址。

这意味着在您的代码中, 您应该将 < code> localhost 替换为 SQL 服务器所在的机器的主机名( 例如: < code> mysql. s032.example.com )。

找到 SQL 机器的地址应该很容易, 如果由主机公司在其控制面板内记录下来的话。 或者通过要求主机供应商的技术支持来告诉您地址 。

作为一名新兵,我认为你“强势”havn t安装了 Mysql-server 并试图安装phpmyadmin。

转到 synaptitic 套件\\ gt; 选择 Mysql- server \ gt; 将自动选择必需的concomoneents; 标记它们安装\ gt; 应用

然后,重新安装 gt; phpmyadmin

工作顺利。

如果上述剂量工作有效,那么,





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签