티스토리 뷰
1. MySQL 5.x
Install
sudo apt-get install mysql-server-5.7
설치확인
/etc/init.d/mysql status
Port확인
sudo netstat -nltp|grep mysql
mysql root 로그인
mysql -uroot -p
mysql 한글설정
vim /etc/mysql/conf.d/mysql.cnf
#이하내용작성
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
character-set-server=utf8
collation-server=utf8_general_ci
init_connect = set collation_connection = utf8_general_ci
init_connect = set names utf8
[mysql]
default-character-set=utf8
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
default-character-set=utf8
[client]
default-character-set=utf8
[mysqldump]
default-character-set=utf8
mysql restart
sudo /etc/init.d/mysql restart
mysql database 생성 및 유저생성
create database test_db;
create user 'test_user'@'%' identified by '1234';
grant all privileges on test_db.* to 'test_user'@'%' identified by '1234';
#등록확인
use mysql
select host, user from user
mysql Binding IP 변경
jdbc:mysql://ip:port/TestDB?characterEncoding=UTF-8&serverTimezone=serverTimezone=Asia/Seoul //UTC
2. MySQL 8.x
install
wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.10-1_all.deb
sudo dpkg –i mysql-apt-config_0.8.10-1_all.deb
sudo apt-get update
sudo apt-get install mysql-server
status
$ sudo systemctl status mysql
restart
$ sudo systemctl restart mysql
3. 테이블 용량확인
select round(data_length / (1024 * 1024), 2) as 'DATA_SIZE(MB)',
round(index_length / (1024 * 1024), 2) as 'INDEX_SIZE(MB)'
from information_schema.TABLES
where table_name = '테이블명'
'Web Development' 카테고리의 다른 글
python pip install 중 error => locale.Error: unsupported locale setting) (0) | 2019.10.23 |
---|---|
Docker 명령어 정리(feat pgadmin4 ) (0) | 2019.10.15 |
Postgresql 기본 설치, 데이터 스토리지 변경, 삭제 (Ubuntu 16.x) (0) | 2019.09.26 |
VI 편집기 유용한 단축키 및 명령어 (0) | 2019.09.22 |
Web Base DBMS Tool "OmniDB" (0) | 2019.09.18 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크