简体   繁体   English

Mysql错误#2002没有建立连接。

[英]Mysql Error #2002 No Connection made.

I know previously several question had been posted on this topic. 我知道以前有几个关于此主题的问题。 But mine is a bit difference. 但是我的有点不同。 I already tried all the previous solution. 我已经尝试过所有以前的解决方案。 What happened is whenever I try to select data from a specific table mysql crashes. 发生的事情是,每当我尝试从特定表中选择数据时,mysql崩溃。 I do work fine on all other tables but whenever I select data from that specific table it crashes even from command line. 我在所有其他表上都能正常工作,但是每当我从该特定表中选择数据时,它甚至会从命令行崩溃。 Now I am unable to mysqldump the database and also cant drop the table as it contains valuable data. 现在,我无法mysqldump数据库,也不能删除表,因为它包含有价值的数据。 Please suggest some options. 请提出一些选择。

Use mysqlcheck to check specific table in db. 使用mysqlcheck检查db中的特定表。

mysqlcheck -c db_name tbl_name -u root -p

provide password and it will tell you whether your table is corrupted or not. 提供密码,它将告诉您您的表是否损坏。

Then you can use following command to repair table 然后可以使用以下命令修复表

mysqlcheck -r db_name tbl_name -u root -p 

mysqlcheck work with MyISAM and archive tables. mysqlcheck与MyISAMarchive表一起使用。

After several attempts and various suggestions from you guys I finally find a somewhat solution. 经过大家的几次尝试和各种建议,我终于找到了某种解决方案。 It is true that the specific table was corrupted. 确实,特定表已损坏。 And all other above mentioned options failed. 上述所有其他选项均失败。 So, I executed a query with limiting my results to 0, 100 and it works fine. 因此,我执行了一个查询,将结果限制为0、100,并且工作正常。 Then I dump that data by using that query with mysqldump. 然后我通过将查询与mysqldump一起使用来转储数据。 I keep on going and changed the limit from 100, 200 and so on. 我继续前进,并将限制从100、200等更改。 Whenever I get error I simply skipped few rows. 每当出现错误时,我都会跳过几行。 At last I had recovered almot 95% of my data which is not bad. 最终,我恢复了almot 95%的数据,这还不错。 Thanks guys for all your support. 谢谢大家的支持。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 远程MySQL连接返回系统错误:111或PDO错误[2002] - Remote MySQL Connection returns System Error: 111 or PDO error [2002] 远程 MySQL 连接错误 SQLSTATE[HY000] [2002] - Remote MySQL Connection Error SQLSTATE[HY000] [2002] 我收到laravel mysql [2002]连接错误 - I'm getting laravel mysql [2002] connection error MySQL 错误 mysqli::__construct(): (HY000/2002): 连接被拒绝 - MySQL Error mysqli::__construct(): (HY000/2002): Connection refused 错误 2002 连接在 PHP 上被拒绝连接到在 MAMP 上运行的 MySQL - Error 2002 Connection refused on PHP connecting to MySQL running on MAMP 当我启动 apache MySQL 服务器时,我收到错误“(HY000/2002):无法建立连接,因为目标机器主动拒绝了它。” - when I start apache MySQL server, I get error “ (HY000/2002): No connection could be made because the target machine actively refused it.” MySQL:错误#2002 - MySQL: Error #2002 Docker MYSQL '[2002] 连接被拒绝' - Docker MYSQL '[2002] Connection refused' 错误:SQLSTATE[HY000] [2002] 无法建立连接,因为目标机器主动拒绝它 - ERROR: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it 错误:无法连接到MySQL。 调试错误:2002调试错误:连接被拒绝 - Error: Unable to connect to MySQL. Debugging error: 2002 Debugging error: Connection refused
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM