Server
서버에서 MySQL(MariaDB) 원격 연결 설정 - 추가
Simon Yoon
2022. 9. 2. 13:52
추가1. DB default charset 변경
DB를 생성하면서 charset을 따로 설정하지 않았을 경우 기본적으로 latin1 으로 설정이 된다. 아래는 기본 언어를 utf8mb4 로 변경하기 위한 과정을 기록한 내용이다.
- 일단 my.cnf 파일을 연다.
$ sudo vi /etc/mysql/my.cnf ------------ # vi 편집화면 [client] default-character-sest = utf8mb4 [mysqld] character-set-client-handshake = FALSE chracter-set-server = utf8mb4 collation-server = utf8mb4_general_ci [mysqldump] default-character-set = utf8mb4 [mysql] default-character-set = utf8mb4
- 설정 파일을 수정하였으므로 DB를 재시작하여 설정을 적용시킨다.
$ sudo systemctl restart mysql.service # charset 확인 mysql > status mysql > SHOW variables LIKE 'c%'; ## Value가 utf8mb4로 변경된 것을 확인할 수 있다
- 참고[Ubuntu] 우분투 MySQL 설정우분투에서 MySQL 관련 설정을 알아봅니다. 언어셋을 따로 설정하지 않고 DB를 생성하게 되면 latin1 로 설정된다. 이 경우 게시판등에 한글이 출력될때는 문제가 없을수도 있으나 DB 자료 자체를 출력해보면 ??? 와 같은 문자로 출력된다. sudo vi /etc/mysql/my.cnf [client] default-character-set = utf8 [mysqld] character-set-client-handshake=FALSE init_connect="SET collation_connection = utf8_general_ci" init_connect="SET NAMES utf8" character-set-server = utf8 collation-server = utf8_general_ci [mysqldump] default-character-set = utf8 [mysql] default-character-set = utf8 수정한 후에는 MySQL을 재시작한다.
https://webdir.tistory.com/217
[MariaDB] Charset 변경 utf8 -> utf8mb4MariaDB를 설치하는 중, 아래 화면에서 Use UTF8 as default server's character set 을 체크하면 자동으로 utf-8로 charset이 설정됩니다. 설치 후 SHOW VARIABLES LIKE 'c%'; 명령어를 사용하여 보면 다음과 같습니다. 위와 같이 utf8mb3와 utf8mb4가 섞여 있는 것을 볼 수 있는데요. 뭔가 찝찝합니다.https://yjh5369.tistory.com/entry/MariaDB-Charset-%EB%B3%80%EA%B2%BD-utf8-utf8mb4
추가2. MariaDB를 MySQL 워크벤치에 연동하기
MariaDB를 MySQL워크벤치에 연결하여 사용하는 것도 가능하다. 기본적인 세팅 방법도 다르지 않다. 중요한 점은 원격을 접속이 가능하도록 세팅을 하는 부분이다.
- MySQL 워크벤치 설치
아래의 링크에서 워크벤치를 다운로드 받아서 설치할 수 있다.
MySQL :: MySQL WorkbenchMySQL Workbench is a unified visual tool for database architects, developers, and DBAs. MySQL Workbench provides data modeling, SQL development, and comprehensive administration tools for server configuration, user administration, backup, and much more. MySQL Workbench is available on Windows, Linux and Mac OS X.https://www.mysql.com/products/workbench/
- 접속 에러(ssl connection error) 해결
Uploaded by N2T