我在 LAMPwiki/List_of_Ubuntu_releases#Ubuntu_12.04_LTS_.28Precise_Pangolin.29">Ubuntu 12.04 LTS (Precise Pangolin) 然后在 phpMyAdmin.我忘记了密码,现在无法登录.当我尝试通过终端更改密码时,我得到:
I installed LAMP on Ubuntu 12.04 LTS (Precise Pangolin) and then set root password on phpMyAdmin. I forgot the password and now I am unable to login. When I try to change password through terminal I get:
ERROR 2002 (HY000): 无法通过套接字连接到本地 MySQL 服务器'/var/run/mysqld/mysqld.sock'(2)
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
我该如何解决这个问题?我无法打开 LAMP、卸载或重新安装.
How can I fix this? I am unable to open LAMP, uninstall it or reinstall it.
我曾经遇到过这个问题,通过安装mysql-server解决了,所以请确认你已经安装了mysql-server,而不是 mysql-client 或其他东西.
I once had this problem and solved it by installing mysql-server, so make sure that you have installed the mysql-server, not the mysql-client or something else.
那个错误意味着文件/var/run/mysqld/mysqld.sock不存在,如果你没有安装mysql-server,那么文件不会存在.所以在这种情况下,用
That error means the file /var/run/mysqld/mysqld.sock doesn't exists, if you didn't install mysql-server, then the file would not exist. So in that case, install it with
sudo apt-get install mysql-server
但是如果mysql-server已经安装并且正在运行,那么你需要检查配置文件.
But if the mysql-server is already installed and is running, then you need to check the config files.
配置文件是:
/etc/my.cnf
/etc/mysql/my.cnf
/var/lib/mysql/my.cnf
在/etc/my.cnf中,socket文件配置可能是/tmp/mysql.sock和/etc/mysql/my.cnf 套接字文件配置可能是 /var/run/mysqld/mysqld.sock.所以,删除或重命名/etc/mysql/my.cnf,让mysql使用/etc/my.cnf,那么问题就可以解决了.
In /etc/my.cnf, the socket file config may be /tmp/mysql.sock and in /etc/mysql/my.cnf the socket file config may be /var/run/mysqld/mysqld.sock. So, remove or rename /etc/mysql/my.cnf, let mysql use /etc/my.cnf, then the problem may solved.
这篇关于ERROR 2002 (HY000): 无法通过 socket '/var/run/mysqld/mysqld.sock' 连接到本地 MySQL 服务器 (2)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何有效地使用窗口函数根据 N 个先前值来决定How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函数根据
在“GROUP BY"中重用选择表达式的结果;条款reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用选择表达式的结果;条款?)
Pyspark DataFrameWriter jdbc 函数的 ignore 选项是忽略整Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函数的 ig
使用 INSERT INTO table ON DUPLICATE KEY 时出错,使用 Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 时出错,使用 for 循环数组
pyspark mysql jdbc load 调用 o23.load 时发生错误 没有合pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 调用 o23.load 时发生错误 没有合适的
如何将 Apache Spark 与 MySQL 集成以将数据库表作为How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何将 Apache Spark 与 MySQL 集成以将数据库表作为