Home > Database > Mysql Tutorial > body text

How to display a MySQL warning that just occurred?

PHPz
Release: 2023-08-25 16:09:22
forward
863 people have browsed it

How to display a MySQL warning that just occurred?

To display MySQL warnings, you can use the following syntax -

SHOW WARNINGS;
Copy after login

The above syntax only displays immediate warnings in the MySQL prompt. SHOW WARNINGS will not work assuming you run another query between them or you lose the MySQL connection.

This is the query that shows the warning -

mysql> SHOW WARNINGS;
Copy after login

This is the output that shows the 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)
Copy after login

The above is the detailed content of How to display a MySQL warning that just occurred?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!