개발/Databse - MySql
[mysql] 언어셋 변경하기
henry.hong
2019. 12. 26. 11:31
블로그의 서버 환경
- Ubuntu 16.04.6 LTS
- AWS EC2
- mysql apt-get으로 설치 (sudo apt-get install mysql-server)
mysql 5.5 버전 이상
sudo vi /etc/mysql/my.cnf
맨밑에 아래 문구를 추가
[mysqld]
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
skip-character-set-client-handshake
서버 재시작
sudo service mysql restart
변경된 상태 확인
ubuntu@localhost:~$ sudo mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.28-0ubuntu0.16.04.2 (Ubuntu)
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> status
--------------
mysql Ver 14.14 Distrib 5.7.28, for Linux (x86_64) using EditLine wrapper
Connection id: 5
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.7.28-0ubuntu0.16.04.2 (Ubuntu)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: utf8mb4
Conn. characterset: utf8mb4
UNIX socket: /var/run/mysqld/mysqld.sock
Uptime: 1 min 11 sec
Threads: 2 Questions: 28 Slow queries: 0 Opens: 108 Flush tables: 1 Open tables: 27 Queries per second avg: 0.394
--------------