问题标签 [mysql-error-2002]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
mysql - ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) after reinstalling mySQL两次
我附上了一张图片,显示了我所做的所有登录尝试,包括 -h localhost 和 -h 127.0.0.1。
我什至检查了空间问题,没有任何问题。
两天前我能够访问数据库,今天它给了我这个错误。
我已经看到清除和重新安装可以解决这个问题,并且已经这样做了以前运行 mySQL 并且不想每次遇到这个问题时都这样做。
请查看我遇到的错误并提出解决方法。
如果要求或根据需要,我愿意提供更多额外数据。
提前致谢。
这是我在 var/log/mysql/error.log 中找到的
mysql - mysql_secure_installation ERROR 2002 无法连接到本地 MySQL 服务器
在 Debian 9 上安装 Mariadb 后,我正在尝试运行 /usr/bin/mysql_secure_installation。脚本可以正常启动,但是在我按“输入”输入没有 root 密码后,我收到以下错误:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
我必须 ctl-c 才能退出脚本。
套接字在 /etc/mysql/debian.cnf 中设置为 /var/run/mysqld/mysqld.sock 它也在 /etc/mysql/mariadb.conf.d/50-server.cnf 中设置为 /var/run /mysqld/mysqld.sock
服务器没有运行。
mysql - 更新 Ubuntu 18.4 后无法启动 mysql 服务器
首先我试图卸载它们
然后我尝试安装它们
这就是我尝试重新启动时发生的情况
这就是我尝试 systemctl 时发生的事情
这是我尝试连接时抛出的错误
谁能帮我解决这个问题,我在某些地方看到我编辑etc/my.cnf来解决这个问题,在我的情况下我没有这样的文件
mysql - innodb 崩溃,错误号为 5,mysql 无法启动
你好,我的数据库今天停止,不再启动。
请帮助我,我丢失了数据库数据。可以重新启动mysql并获取数据或解决此错误吗?谢谢你。
mysql - mysqldump:出现错误:2002:尝试连接时“无法通过套接字'/run/mysqld/mysqld.sock' (2) 连接到本地 MySQL 服务器”
我正在尝试导出我的 wordpress 数据库,php wp-cli.phar db export
但出现此错误
寻找答案后,我尝试启动 mysql.servicesudo systemctl start mysql
但找不到
我也尝试过启动 mariadb.servicesudo systemctl start mariadb
但它不起作用
我找不到有关如何解决这些错误的答案,有人可以帮我吗?
mysql - 使用 brewed mysql 时出现错误 2002 (HY000)
我正在使用 MAMP,并已将其从我的 MAC OS 中完全删除。发这个,
- 我使用 brew 安装了 mysql5.7
- 将 mysql 路径添加到 zshrc / bash 配置文件
- 使用启动mysql服务
brew services start mysql@5.7
现在,当我尝试在命令行上访问 mysql 时,它给了我错误ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)
我已经在 my.cnf 中添加了到/tmp/mysql.sock的套接字路径,并尝试创建与 ERROR 2002 (HY000) 相同的符号链接:无法通过套接字 '/Applications/MAMP/ 连接到本地 MySQL 服务器tmp/mysql/mysql.sock' (2) 但没有运气。
对此的建议将不胜感激!
mysql - 尝试在 Ubuntu 18.04 上将 MySQL 服务器从 5.7 升级到 8.0 时出错
我不知道是我做的不对,还是出现了一些我看不到的缺陷。以下是我尝试设置服务器的步骤,但我一定遗漏了一些东西。
1)添加APT存储库:
$ wget https://repo.mysql.com//mysql-apt-config_0.8.14-1_all.deb
$ sudo dpkg -i mysql-apt-config_0.8.14-1_all.deb
2) 配置 mysql-apt-config 屏幕
选择MySQL服务器&集群(当前选择:mysql 8.0)
选择mysql-8.0作为要接收的服务器版本
最后选择ok
3)更新和安装MySQL服务器
$ sudo apt-get 更新
$ sudo apt-get 安装 mysql-server
当我这样做时,以下显示:
我输入命令“mysql -u root -p”并输入我的密码。终端显示错误2002 (HY000): can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)。我使用命令“sudo find / -type s”搜索 sock,但该套接字未显示在列表中。通过文件和终端,我导航到目录“/var/run/mysqld”,并希望找到一些文件,但那里什么也没有。到目前为止,我已经尝试从我的机器上完全卸载 mysql 并重新安装,但得到了相同的结果。否则,Ubuntu 已经升级和更新,我有 MySQL Workbench 8.0.20。
php - PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] on heavy query
- I checked the similar questions associated but they don't have to do with my problem and none of the answers solve my problem -
I have php script executing a mysql select query to export the database in a xls file, it works fine on my test database with a few rows but on my production database with thousands of rows I get a 500 error, being an heavy query I have on the top of the php script:
I checked the php error log and I found this error on the new PDO
line:
I thought the problem could be a timeout in the mysql connection but as you can see from the slow query log the query time of the 2 attempts is different:
mysql - Docker 无法通过套接字连接到本地 MySQL 服务器
我是 docker 的新手,我正面临一个奇怪的错误。
当我跑
docker run --name some-mysql-5 -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=secret mysql:latest
其次是
mysql 工作正常,我可以创建和填充数据库。
但是当我尝试创建一个持久主机卷以创建一个这样的共享数据库时:
docker run --name some-mysql-4 -v C:\Users\User\Desktop\shared_vol_test:/var/lib/mysql/data -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=secret mysql:latest
其次是
我收到以下错误
我也尝试以管理员身份运行它,但结果是一样的。
我究竟做错了什么?
我是否以正确的方式创建共享和持久卷?