Once upon a time, I did this, as the deploy user:
alter database crit character set utf8 collate utf8_general_ci;
..and then this, again as the deploy user:
alter database crit character set latin1 collate latin1_general_ci;
And now, I get different settings depending on who I log into mysql as. First, as the deploy user:
deploy@crit$ !mysql
mysql crit -u root -p*** -h ***
...
Server version: 5.6.23-log MySQL Community Server (GPL)
...
mysql> show variables like 'char%';
+--------------------------+-------------------------------------------+
| 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 | /rdsdbbin/mysql-5.6.23.R1/share/charsets/ |
+--------------------------+-------------------------------------------+
This is what root's settings look like:
root@crit# !mysql
mysql crit -u root -p*** -h ***
...
Server version: 5.6.23-log MySQL Community Server (GPL)
...
mysql> show variables like 'char%';
+--------------------------+-------------------------------------------+
| Variable_name | Value |
+--------------------------+-------------------------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /rdsdbbin/mysql-5.6.23.R1/share/charsets/ |
+--------------------------+-------------------------------------------+
Why are character_set_client
, character_set_connection
, character_set_results
settings different?