본문 바로가기
반응형

전체 글193

Mysql/Mariadb 컬럼 변경/추가 Mysql 기반 컬럼명 변경과 컬럼 추가, 타입변경 하는 방법에 대해 알아보겠습니다. ​ 1. 컬럼명 변경 (change) -- 컬럼명 확인 MariaDB [test]> desc test ; +-------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+-------------+------+-----+---------+-------+ | aa | varchar(10) | YES | | NULL | | +-------+-------------+------+-----+---------+-------+ 1 row in set (0.00 sec) -- 컬럼명 변경 MariaD.. 2020. 12. 16.
Mysql/Mariadb 버전 확인 Mysql 기반 버전확인 방법에 대해 알아보겠습니다. ​ 1. linux 명령어로 확인 mysql> mysql --version mysql Ver 15.1 Distrib 10.2.32-MariaDB, for Linux (x86_64) using readline 5.1 mysql> 2. DB 접속으로 확인 ysql> mysql -uroot -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 474 Server version: 10.2.32-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corpora.. 2020. 12. 16.
Mysql/Mariadb 테이블 및 오브젝트 정보 확인 Mysql/maria DB에서 테이블, 컬럼, 오브젝트 정보에 대해 알아보겠습니다. ​ ​ 1. Table 정보 확인 Table에 대한 여러가지 정보를 확인 할 수 있다. update_time은 최종 dml 시간이 표기되지만 DB를 재기동하게되면 update_time이 null로 변하게 된다. MariaDB [(none)]> desc information_schema.tables ; +-----------------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------------+---------------------+------+-----+-------.. 2020. 12. 16.
MySQL/mariadb Table 및 Index Size 확인 Mysql기반 테이블과 인덱스 사이즈 확인방법에 대해 알아보겠습니다. test 결과 row 건수는 정확하게 일치하지는 않는거 같습니다. -- 테이블 및 전체 인덱스 사이즈 확인 mysql> select table_schema, table_name, -> round(sum(data_length)/1024/1024,2) as 'table Size(Mb)', -> round(sum(index_length)/1024/1024,2) as 'index Size(Mb)', -> max(table_rows) as rows_number, -> max(auto_increment) as auto_increment_value -> from information_schema.tables -> where table_schema .. 2020. 12. 16.
반응형