I am working on cPanel Database. Recently I edited some tables and deleted one table using PHPMyAdmin of cPanel. For sometime I saw Loading notification on the screen. But After 2 hours When I refreshed the cPanel and reopon phpMyAdmin then it get stuck at The system will redirect you in a moment. It has been 5 hours and still can't open/edit my database neither by python code nor by phpMyadmin. I can't Delete the database because I didn't back up, unfortunately. Any suggestion will highly be appreciated.
This simple code is also running for 4 hours. Previously it get executed in 1 sec.
mydb =mysql.connector.connect(host="xyz",user="xyz",password="xyz",database="xyz",port=3306)
cursor = mydb.cursor(buffered=True)
table = 'XXXX'
sql_select_Query = f"SELECT DISTINCT coin FROM {table}"
cursor.execute(sql_select_Query)
c = cursor.fetchall()
cPanel Version 100.0 (build 11)
Apache Version 2.4.52
PHP Version 7.3.33
MySQL Version 5.7.37
CodePudding user response:
Following Steps Worked for me:
1-Restarting MYSQL from WHM
2-Repair Database
CodePudding user response:
It seems some query got stuck, either waiting for a lock to clear or because your table is so large (and not optimized or indexed properly) that the query was still running (this is less likely because it ran in 1 second previously). A long query like that could block access from other sources or there could have been a problem with the server (such as running out of memory) that caused the entire MySQL daemon/service to exit.
If you were able to connect, say through the command line client, you could run some queries to see what exactly was blocking your access. Since you can't connect, it seems to me something may have happened to the entire service, so you might see some evidence in the event log, syslog, or whatever other means you can use to view process failures in your operating system.
In any case, stopping and restarting the daemon/service is the simplest solution. There should be no need to delete the entire database and start all over; restarting the daemon should be enough to kill off the old queries and get access again.