无法连接到MySQL-无法找到Mysql.sock Phpmyadmin错误#2002 [英] Cannot Connect To MySQL - Cannot Find Mysql.sock Phpmyadmin Error #2002

查看:111
本文介绍了无法连接到MySQL-无法找到Mysql.sock Phpmyadmin错误#2002的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用phpmyadmin设置的mysql数据库上工作...我将服务器上的数据库复制到了mac服务器上的其他目录中,因此我正在开发的网站可以访问它...当我更改时保存并重新启动服务后,将服务器管理"中的MySQL设置更改为新的目录位置,它将无法再连接到数据库.我也重新启动了服务器.

I have been working on a mysql database that I set up with phpmyadmin... I copied the database on my server to a different directory on my mac server so a website I am developing can access it... When I changed the MySQL setting in Server Admin to the new directory location, it could not connect to the database anymore, after I saved and restarted the service. I have rebooted the server as well.

在将文件复制到网站目录时,我没有更改任何文件.

I did not alter any files as I copied them to the directory of my website.

看到那不起作用,我将设置放回到/var/mysql的默认目录,然后保存&重新启动服务.

Seeing as that did not work, I put the setting back to the default directory of /var/mysql , then saved & restarted the service.

在服务器管理概述"中,它指出:MySql服务是:正在关闭.我已经尝试过:单击底部的启动MySQL"(程序正在响应),重新启动服务,删除并添加了该服务,并更改了/var/mysql文件夹的权限.

In the Overview of Server Admin, it states: MySql Service is: Shutting Down. I have tried: clicking start MySQL at the bottom (the program is responding), restarting the service, removed and added the service, and changed the permissions of the /var/mysql folder.

当我尝试在Web浏览器中通过phpmyadmin访问mysql时,我得到:#2002无法登录到MySQL服务器.

When I try to access mysql through phpmyadmin in a web browser, I get: #2002 Cannot log in to the MySQL server.

我认为MySQL服务器没有启动,并且这样做有问题.从我在Web上的研究中,我需要验证mysql.sock是否存在于/var/mysql目录中.我搜索了我的mac,但找不到它.我不想重新安装它,因为我不必这样做.

I figure the MySQL server did not start and is having a problem doing so. From my research on the web I need to verify that mysql.sock exists in the /var/mysql dir.... which it does not. I did a search of my mac and could not find it. I do not wish to reinstall this as I shouldn't have to.

在终端中,我已经尝试过了: mysqladmin重启 mysqladmin:连接到"localhost"服务器失败 错误:无法通过套接字'/var/mysql/mysql.sock'(2)连接到本地MySQL服务器" 检查mysql是否正在运行以及套接字:'/var/mysql/mysql.sock'是否存在!

In terminal, I have tried this: mysqladmin restart mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)' Check that mysql is running and that the socket: '/var/mysql/mysql.sock' exists!

有什么想法吗?一切都是最新的.

Any Ideas?? Everything is up to date as well.

谢谢

推荐答案

可悲的是,我只是在该服务器上重新安装了mySQL程序包,并且没有碰到phpmyadmin,它仍然有效.谢谢您的投入

Sadly, I just reinstalled mySQL package on that server, and didn't touch phpmyadmin and it worked. Thank you for the input though

这篇关于无法连接到MySQL-无法找到Mysql.sock Phpmyadmin错误#2002的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆