Home > Database > Mysql Tutorial > body text

How to change MySQL error message language?

PHPz
Release: 2023-09-08 13:49:10
forward
700 people have browsed it

How to change MySQL error message language?

You can use lc_messages to change the MySQL error message language. The syntax is as follows -

SET lc_messages = 'yourLanguage';
Copy after login

To understand the concept, let us create a table with some errors and check the language of the error message.

Here we set the local message to French. Let us first create a table −

mysql> create table errorMessagelanguage
   -> (
   -> Error_MessageId int,
   -> Error_Message varchar(100),
   -> );
Copy after login
Copy after login

The error message is as follows −

ERROR 1064 (42000): Erreur de syntaxe près de ')' à la ligne 5
Copy after login

Now you can set the error message to English. The query is as follows -

mysql> set lc_messages ='en_US';
Query OK, 0 rows affected (0.00 sec)
Copy after login

Now create a table with error and check the error message language -

mysql> create table errorMessagelanguage
   -> (
   -> Error_MessageId int,
   -> Error_Message varchar(100),
   -> );
Copy after login
Copy after login

Here is the output −

ERROR 1064 (42000): 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 ')' at line 5
Copy after login

The above is the detailed content of How to change MySQL error message language?. 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