错误2002(HY000):无法通过套接字’/var/run/mysqld/mysqld.sock’(2)连接到本地MySQL服务器
我尝试了在互联网上找到的所有内容,但是无法解决在Ubuntu 11.04上出现的问题。
我尝试了这些事情:
sudo /usr/sbin/mysqld start
service mysqld start
ps ax | grep mysqld
并获得结果3419 pts/0 S+ 0:00 grep --color=auto mysqld
/var/run/mysqld/mysqld.sock
mysql
用户权限tasksel
配置LAMP,其他所有工作都正常,但是mysql产生相同的错误。与mysqld -P 3305
它一起运行时会产生错误
110630 0:24:24 [Warning] Can't create test file /var/lib/mysql/nazar-studio.lower-test
110630 0:24:24 [Warning] Can't create test file /var/lib/mysql/nazar-studio.lower-test
mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 13)
110630 0:24:24 [ERROR] Aborting
110630 0:24:24 [Note] mysqld: Shutdown complete
这是mysql错误日志
10630 0:07:22 [Note] Plugin 'FEDERATED' is disabled.
110630 0:07:22 InnoDB: Initializing buffer pool, size = 8.0M
110630 0:07:22 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
110630 0:07:22 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
110630 0:07:22 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
110630 0:07:22 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
110630 0:07:23 InnoDB: Started; log sequence number 0 0
110630 0:07:23 InnoDB: Starting shutdown...
110630 0:07:28 InnoDB: Shutdown completed; log sequence number 0 44233
110630 0:07:28 [Note] Plugin 'FEDERATED' is disabled.
110630 0:07:28 InnoDB: Initializing buffer pool, size = 8.0M
110630 0:07:28 InnoDB: Completed initialization of buffer pool
110630 0:07:28 InnoDB: Started; log sequence number 0 44233
ERROR: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER TABLE user ADD column Show_view_priv enum('N','Y') CHARACTER SET utf8 NOT ' at line 1
110630 0:07:28 [ERROR] Aborting
110630 0:07:28 InnoDB: Starting shutdown...
110630 0:07:34 InnoDB: Shutdown completed; log sequence number 0 44233
110630 0:07:34 [Note] /usr/sbin/mysqld: Shutdown complete
110630 0:07:34 [Note] Plugin 'FEDERATED' is disabled.
110630 0:07:34 InnoDB: Initializing buffer pool, size = 8.0M
110630 0:07:34 InnoDB: Completed initialization of buffer pool
110630 0:07:34 InnoDB: Started; log sequence number 0 44233
110630 0:07:34 InnoDB: Starting shutdown...
110630 0:07:39 InnoDB: Shutdown completed; log sequence number 0 44233
110630 0:07:39 [Note] Plugin 'FEDERATED' is disabled.
110630 0:07:39 InnoDB: Initializing buffer pool, size = 8.0M
110630 0:07:39 InnoDB: Completed initialization of buffer pool
110630 0:07:39 InnoDB: Started; log sequence number 0 44233
ERROR: 1050 Table 'plugin' already exists
110630 0:07:39 [ERROR] Aborting
110630 0:07:39 InnoDB: Starting shutdown...
110630 0:07:44 InnoDB: Shutdown completed; log sequence number 0 44233
110630 0:07:44 [Note] /usr/sbin/mysqld: Shutdown complete
110630 0:18:30 [Note] Plugin 'FEDERATED' is disabled.
110630 0:18:30 InnoDB: Initializing buffer pool, size = 8.0M
110630 0:18:30 InnoDB: Completed initialization of buffer pool
110630 0:18:30 InnoDB: Started; log sequence number 0 44233
mysqld: Too many arguments (first extra is 'start').
Use --verbose --help to get a list of available options
110630 0:18:30 [ERROR] Aborting
110630 0:18:30 InnoDB: Starting shutdown...
110630 0:18:35 InnoDB: Shutdown completed; log sequence number 0 44233
110630 0:18:35 [Note] mysqld: Shutdown complete
如何解决此错误?
我做了实验,最后用这些命令解决了
sudo chown mysql:root /var/lib/mysql/ -R
sudo chmod g+rw /var/lib/mysql/ -R
sudo /usr/sbin/mysqld --skip-grant &
它开始运行了……Hurraaahhhhhhhhh !!!!!!!!!!!!
问题内容: 上传或提交页面时,我的网站上出现以下错误: mysql_real_escape_string()[function.mysql-real-escape- string]:无法通过套接字’/var/lib/mysql/mysql.sock’连接到本地MySQL服务器(2) 这到底是什么意思? 问题答案: 由于对该错误的调用引发了错误,因此它意味着您没有先调用该错误并将有效的数据库句柄传递
问题内容: 当我在测试套件中尝试连接到本地MySQL服务器时,它失败并显示以下错误: 但是,我始终可以通过运行命令行mysql程序连接到MySQL 。A 显示服务器正在运行,并 确认套接字存在。此外,如果在except该异常的子句中打开调试器,则可以使用完全相同的参数可靠地进行连接。 这个问题可以相当可靠地重现,但是似乎不是100%,因为每当我遇到一次蓝月亮时,我的测试套件就可以运行而不会遇到此错
问题内容: 我在尝试连接mysql时遇到大问题。当我跑步时: 我有以下错误: 我的确在目录下。 在我有: 并且在我有: 我已经使用重新启动了Apache 但是我仍然有错误。 否则,我不知道这是否相关,但是当我得到时 问题答案: 如果您的文件my.cnf(通常在 / etc / mysql / 文件夹中)已正确配置为 您可以使用以下命令检查mysql是否正在运行: 尝试将您的权限更改为mysql文件
问题内容: 当我尝试连接到mysql时出现以下错误: 有解决此错误的方法吗?背后的原因可能是什么? 问题答案: 您要连接到“ localhost”还是“ 127.0.0.1”?我注意到,当您连接到“ localhost”时,使用套接字连接器,但是当您连接到“ 127.0.0.1”时,则使用TCP / IP连接器。如果套接字连接器未启用/工作,则可以尝试使用“ 127.0.0.1”。
已尝试所有职位以获取解决方案。错误2002(HY000):无法通过套接字“/var/run/mysqld/mysqld.sock”(2)连接到本地MySQL服务器 无法通过套接字“/var/MySQL/MySQL.sock”(38)连接到本地MySQL服务器 在后续工作中又发现了一个问题..sudo:有效的uid不是0,安装的sudo是否是setuid root? 所以对于这篇试过的跟帖 有谁能给
问题内容: 当我尝试使用php mysqli类连接到mysql数据库时,出现此错误。使用以下代码: 为了安全起见,密码为*。 我创建了对外部IP地址和本地主机具有所有特权的用户。当我运行时:它会正确显示这两个用户。 我进行了一些研究,并使用此基准测试:https : //stackoverflow.com/a/2183134/1839439来查看它所连接的内容。事实证明它是唯一能够连接到和其为lo