프로젝트 때 사용할 mysql idc dategrip
사용할 os ubuntu
sudo snap install datagrip --classic
sudo snap refresh datagrip
file > new project
좌측 중앙에 + 버튼 > data source > mysql
name = @localhost
HOST = localhost
User = root
Password = ubuntu
apply > ok
show databases;
[2021-05-20 11:12:10] Server returns invalid timezone. Need to set 'serverTimezone' property.
(base) hongtae@user:~$ date
2021. 05. 20. (목) 11:14:42 KST
(base) hongtae@user:~$ sudo ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
[sudo] password for hongtae:
(base) hongtae@user:~$ date
2021. 05. 20. (목) 11:15:07 KST
mysql> SELECT @@GLOBAL.time_zone, @@SESSION.time_zone;
+--------------------+---------------------+
| @@GLOBAL.time_zone | @@SESSION.time_zone |
+--------------------+---------------------+
| SYSTEM | SYSTEM |
+--------------------+---------------------+
1 row in set (0.00 sec)
set global time_zone = 'Asia/Seoul';
set time_zone = 'Asia/Seoul';
mysql> set global time_zone = 'Asia/Seoul';
ERROR 1298 (HY000): Unknown or incorrect time zone: 'Asia/Seoul'
mysql> set time_zone = 'Asia/Seoul';
ERROR 1298 (HY000): Unknown or incorrect time zone: 'Asia/Seoul'
dev.mysql.com/downloads/timezones.html 에서 버전에 맞는 timezone 정보파일을 받는다.
(base) hongtae@user:~$ mysql --version
mysql Ver 8.0.25 for Linux on x86_64 (MySQL Community Server - GPL)
mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.25 |
+-----------+
1 row in set (0.00 sec)
mysql> SHOW VARIABLES LIKE 'version';
+---------------+------------+
| Variable_name | Value |
+---------------+------------+
| version | 5.6.23-log |
+---------------+------------+
1 row in set (0.00 sec)
https://dev.mysql.com/doc/refman/8.0/en/
8.0 대를 확인 후 mysql 홈피에 들어가 설치한다
mysql 5.8 이상
timezone_2021a_leaps_sql.zip - Non POSIX with leap seconds
을 다운
timezone 디렉토리 압축 해제 후
sudo mysql -u root -p mysql < ~/다운로드/timezone_2021a_leaps_sql.zip
(base) hongtae@user:~/다운로드$ ll
drwxr-xr-x 2 hongtae hongtae 4096 1월 29 22:48 timezone_2021a_leaps_sql/
(base) hongtae@user:~/다운로드$ cd timezone_2021a_leaps_sql/
(base) hongtae@user:~/다운로드/timezone_2021a_leaps_sql$ ll
(base) hongtae@user:~/다운로드/timezone_2021a_leaps_sql$ ll
total 1392
drwxr-xr-x 2 hongtae hongtae 4096 1월 29 22:48 ./
drwxr-xr-x 6 hongtae hongtae 4096 5월 20 13:05 ../
-rw-r--r-- 1 hongtae hongtae 1414895 1월 29 22:48 timezone_leaps.sql
파일 밀어넣기
(base) hongtae@user:~/다운로드/timezone_2021a_leaps_sql$ mysql -u root -p mysql < timezone_leaps.sql
Enter password:
(base) hongtae@user:~/다운로드/timezone_2021a_leaps_sql$ cd
vi /etc/mysql/mysql.conf.d/mysqld.cnf
default-time-zone=Asia/Seoul 을 맨 아래에 적어넣음
**추가내용
우분투 리눅스 tomcat 서버 시간 + 한국으로 설정하기**
cp /usr/share/zoneinfo/Asia/Seoul /etc/localtime
mysql> select @@global.time_zone
-> ;
+--------------------+
| @@global.time_zone |
+--------------------+
| Asia/Seoul |
+--------------------+
1 row in set (0.00 sec)
mysql> select @@session.time_zone;
+---------------------+
| @@session.time_zone |
+---------------------+
| Asia/Seoul |
+---------------------+
1 row in set (0.00 sec)
다시 데이터 그립
File > now > project
좌측 중앙에 + 버튼 > data source > mysql
name = @localhost
HOST = localhost
User = root
Password = ubuntu
database = brandi_test1
apply > ok
하면 connect 라는 명령어가 뜬다