-------------------------------------------------- | Variable_name | Value | bytes | character_set_client | utf8 | character_set_connection | utf8 | character_set_database | latin1 |
-------------------------------------------------- | Variable_name | Value | bytes | character_set_client | utf8 | character_set_connection | utf8 | character_set_database | latin1 |
+ -------------------------- + ---------------------------- +
| Variable_name | Value |
+ -------------------------- + ---------------------------- +
| Character_set_client | utf8 |
| Character_set_connection | utf8 |
| Character_set_database | latin1 |
| Character_set_filesystem | binary |
| Character_set_results | utf8 |
| Character_set_server | latin1 |
| Character_set_system | utf8 |
| Character_sets_dir |/usr/share/mysql/charsets/|
+ -------------------------- + ---------------------------- +
8 rows in set (0.00 sec)
The character_set_database and character_set_server encoding still inherit the self-compiled
Directly modify the configuration file my. cnf: [mysqld] and add default-character-set = utf8
$ Sudo service mysql restart
Mysql stop/waiting
Start: Job failed to start
The service cannot start.
Upgrade ubuntu12.04 for the first time.
The simplest way is to add two more configurations under [mysqld ]:
Default-storage-engine = INNODB
Character-set-server = utf8
Collation-server = utf8_general_ci
$ Sudo service mysql start
Mysql start/running, process 22704
$ Mysql-u root-p
Enter password:
Mysql> show variables like 'character % ';
+ -------------------------- + ---------------------------- +
| Variable_name | Value |
+ -------------------------- + ---------------------------- +
| Character_set_client | utf8 |
| Character_set_connection | utf8 |
| Character_set_database | utf8 |
| Character_set_filesystem | binary |
| Character_set_results | utf8 |
| Character_set_server | utf8 |
| Character_set_system | utf8 |
| Character_sets_dir |/usr/share/mysql/charsets/|
+ -------------------------- + ---------------------------- +
8 rows in set (0.01 sec)
The code is removed.