简体   繁体   中英

MySQL queries not running on command line

I am using MySQL through command line in ubuntu. After the 'use database_name', only 'desc table_name' is working. I am not able to run any of select, update, insert, alter table queries. When I hit the query with ';' at the end, I just see blank result.

mysql> SELECT * FROM WEB_POLICY;

and the console stops. No error displayed. Anybody has idea, what might be wrong ? Connection is not a problem, as its local host. I was able to run queries successfully till an hour back.

It is not console stops, it's query executing. Probaly, the table is big, and SELECT * - the most inefficent possible query - may take a lot of time to execute. Try something easier to test everything works, like this:

SELECT id FROM WEB_POLICY LIMIT 10

for example (if it has an id column, of course).

Edit: if it is not big table, then the most possible issue is uncommited transaction in another console or application (if engine is InnoDB), or LOCK'ed table (if engine is MyISAM). For MyISAM you release lock by UNLOCK TABLES WEB_POLICY . For InnoDB it may be a bit harder: 1. SHOW FULL PROCESSLIST for displaying all active connections 2. KILL ones with "query" status.

Or just simply restart server (fine for localhost) for forced rollback open transactions and release locks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM