12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
mysql数据库 时间:2024-12-25 09:56:17
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
防伪码:没有相当程度的孤独是不可能有内心的平和。
【现象】mysql.sock被删除,导致无法连接数据库。[root@MySQL-01~]#mysql-uroot-pEnterpassword:ERROR2002(HY000):Can'tco
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
防伪码:没有相当程度的孤独是不可能有内心的平和。
【现象】
mysql.sock被删除,导致无法连接数据库。
[root@MySQL-01~]#mysql-uroot-pEnterpassword:ERROR2002(HY000):Can'tconnecttolocalMySQLserverthroughsocket'/tmp/mysql.sock'(2)
提示无法通过mysql.sock连接MySQL server。
【解决】
方案一:重启数据库会重新创建mysql.sock。
方案二:若暂时无法重启数据库,可以通过TCP协议连接数据库。
MySQL默认使用的是UNIX套接字文件连接,而不是TCP/IP从。MySQL4.1开始,可以用--protocol=TCP|SOCKETPIPE|MEMORY指定选项连接数据库。
[root@MySQL-01~]#mysql-uroot-p--protocol=TCPEnterpassword:WelcometotheMySQLmonitor.Commandsendwith;or\g.YourMySQLconnectionidis16127Serverversion:5.6.36-logMySQLCommunityServer(GPL)Copyright(c)2000,2017,Oracleand/oritsaffiliates.Allrightsreserved.OracleisaregisteredtrademarkofOracleCorporationand/oritsaffiliates.Othernamesmaybetrademarksoftheirrespectiveowners.Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.mysql>
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19