• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

解决mysql登陆时出现“ERROR 2002 (HY000): Can't conne_MySQL

mysql 搞代码 4年前 (2022-01-09) 34次浏览 已收录 0个评论

gaodaima.com

mariadb同样适用

首先检查mysql状态

linux-6yo1:~ # /etc/init.d/mysql statusChecking for service MySQL:                                          unusedmysql.service - LSB: Start the MySQL database server          Loaded: loaded (/etc/init.d/mysql)          Active: inactive (dead)          CGroup: name=systemd:/system/mysql.serviceJul 17 15:28:28 linux-6yo1.site systemd[1]: Stopped LSB: Start the MySQL dat....Jul 17 15:30:38 linux-6yo1.site systemd[1]: Stopped LSB: Start the MySQL dat....

发现Active: inactive (dead)

重启mysql.

linux-6yo1:~ # /etc/init.d/mysql restart
redirecting to systemctl restart mysql

再次查看mysql状态

linux-6yo1:~ # ps aux | grep mysql

root 5227 0.5 0.1 3204 1320 ? S 15:39 0:00 /bin/sh /usr/bin/mysqld_safe –mysqld=mysqld –user=mysql –pid-file=/var/run/mysql/mysqld.pid –socket=/var本文来源gao@!dai!ma.com搞$$代^@码!网/run/mysql/mysql.sock –datadir=/var/lib/mysql

mysql 5575 2.2 4.6 472456 47808 ? Sl 15:39 0:00 /usr/sbin/mysqld –basedir=/usr –datadir=/var/lib/mysql –plugin-dir=/usr/lib/mysql/plugin –user=mysql –log-error=/var/log/mysql/mysqld.log –pid-file=/var/run/mysql/mysqld.pid –socket=/var/run/mysql/mysql.sock –port=3306root 5609 0.0 0.0 2756 772 pts/2 S+ 15:39 0:00 grep –color=auto mysql

linux-6yo1:~ # /etc/init.d/mysql status

Checking for service MySQL: runningmysql.service – LSB: Start the MySQL database server Loaded: loaded (/etc/init.d/mysql) Active: active (running) since Wed, 2013-07-17 15:39:11 CST; 29s ago Process: 5100 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS) CGroup: name=systemd:/system/mysql.service ├ 5227 /bin/sh /usr/bin/mysqld_safe –mysqld=mysqld –use… └ 5575 /usr/sbin/mysqld –basedir=/usr –datadir=/var/lib…Jul 17 15:39:06 linux-6yo1.site mysql[5100]: Please report any problems with…!Jul 17 15:39:06 linux-6yo1.site mysql[5100]: The latest information about Ma….Jul 17 15:39:06 linux-6yo1.site mysql[5100]: You can find additional informa…:Jul 17 15:39:06 linux-6yo1.site mysql[5100]: http://dev.mysql.comJul 17 15:39:06 linux-6yo1.site mysql[5100]: Support MariaDB development by …mJul 17 15:39:06 linux-6yo1.site mysql[5100]: Monty Program Ab. You can conta….Jul 17 15:39:06 linux-6yo1.site mysql[5100]: Alternatively consider joining …:Jul 17 15:39:06 linux-6yo1.site mysql[5100]: http://kb.askmonty.org/en/contr…/Jul 17 15:39:11 linux-6yo1.site mysql[5100]: Starting service MySQL ..doneJul 17 15:39:11 linux-6yo1.site systemd[1]: Started LSB: Start the MySQL dat….

gaodaima.com


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:解决mysql登陆时出现“ERROR 2002 (HY000): Can't conne_MySQL

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址