Character Set Issues in MySQL stored procedures

Source: Internet
Author: User
Tags mysql command line

MySQL StorageIt is a very important task in MySQL database operations and is also applied to everyone's daily work. Parameters cannot be defined during stored procedures.Character SetTherefore, when a stored procedure is called, the global variable character_set_server is read by default, and the value of this global variable is only read when mysqld is started as the default transport character set in the stored procedure. Therefore, if the data table/field uses the system's default character set (such as latin1), it will not be faulty when calling the stored procedure to update some non-English string fields. However, if the character set of the data table/field is not the default Character Set of the system (for example, the default value is latin1 and the data table uses utf8), the problem may occur.

Solution:

In my. cnf (my. ini in windows), add a line:

Default-character-set = utf8

Or

Character-set-server = utf8

Or. It does not work if the SET syntax is used in the mysql command line after mysqld is started.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.