- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How do I show a MySQL warning that just happened?
To show a MySQL warning, you can use the below syntax −
SHOW WARNINGS;
The above syntax only displays the immediate warning from MySQL prompt. Suppose you run another query between them or you have lost the MySQL connection, then SHOW WARNINGS will not work.
Here is the query to display warnings −
mysql> SHOW WARNINGS;
Here is the output that displays immediate warning −
+-------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Level | Code | Message | +-------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Error | 1064 | You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'QUERY CACHE' at line 1 | +-------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
Advertisements