MARIADB Set database default encoding __ Database

Source: Internet
Author: User

MARIADB's default encoding is latin1, insert Chinese will garbled, so need to change the encoding to UTF8, but the current online modification methods are mostly for MySQL, although MySQL and Mariadb is a, but the method for the MARIADB does not apply, The solution is documented here.

For more mariadb tutorials, focus on the Linux University Network (linuxdaxue.com)

1, login MySQL, use

Show VARIABLES like ' character% ';

See the character set currently in use, there should be several not UTF-8 format.

2. The configuration file to be modified is located in the/ETC/MY.CNF.D directory:

Client.cnf

Join in the [Client] field

Default-character-set=utf8

Server.cnf

Join in the [mysqld] field

Character-set-server=utf8

The Systemctl restart MARIADB configuration takes effect and the modified effect is as follows:

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.