When querying a database containing non-Latin1 characters, using the 'set names utf8' command can disrupt tabular formatting in the command line. This article explores solutions to maintain this formatting while displaying UTF8-encoded data.
Run the client with the '--default-character-set=utf8' option:
mysql --default-character-set=utf8
Or add it as a default in '/etc/mysql/my.cnf':
[mysql] default-character-set=utf8
By setting the default character set to UTF8, you force the following configuration variables to be UTF8:
show variables like '%char%';
MySQL's UTF8 encoding is not a fully compliant UTF-8 implementation. For full UTF-8 support, use the 'utf8mb4' charset. Run the client with '--default-character-set=utf8mb4'.
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3