By default, mysql is installed on Ubuntu with the character set latin1. 1. Support showcharacterset for viewing character sets; 2. Check the variables showvariableslike "character_set %" for character sets; 3. Set the default character set to solve garbled characters. The simplest way is to modify the default character set. Modify the default character set to utf8: Find/etc/mysql/my. cnf, in [mysq
By default, mysql is installed on Ubuntu with the character set latin1.
1. View character set support
Show character set;
2. View character set variables
Show variables like "character_set % ";
3. Set the default Character Set
To solve garbled characters, the easiest way is to modify the default character set. Modify the default character set to utf8:
Find/etc/mysql/my. cnf and add default-character-set = utf8 under [mysqld ].
Or if the desktop system is installed, you can use mysqladmin to modify the startup parameter. In the Advanced option, change Def. CharSet to utf8 to save and restart. However, you cannot modify this option. You can use the root user to open my. cnf for modification.
4. start, stop, and restart in linux
/Etc/init. d/mysql start/stop/restart