본문 바로가기
반응형

+ DataBase25

[MySQL] Table Schema(테이블 스키마) 확인 MySQL을 사용하다보면 간혹 Table(테이블)의 Schema(스키마) 구조를 확인해야하는 경우가 있다. 이때 아래와 같은 방법으로 확인하도록 하자. 1. Table Schema 확인 mysql> show create table TABLENAME; 2017. 8. 1.
[Info] SQL Fiddle 사이트 Test DB가 없을 경우 해당 사이트를 통해서 간단한 쿼리(Query)등 대해서 확인 할 수 있다. http://sqlfiddle.com SQL Fiddle | A tool for easy online testing and sharing of database problems and their solutions. Query Panel Use this panel to try to solve the problem with other SQL statements (SELECTs, etc...). Results will be displayed below. Share your queries by copying and pasting the URL that is generated after each run. sqlfi.. 2016. 12. 10.
[MySQL] 데이터베이스 백업 하기(DataBase Dump) 1. 전체 Dump 진행 1.1 Local $mysqldump -u 아이디 -p 데이터베이스명 > 저장 파일명.sql -> $mysqldump -u root -p data > sql_dump.sql 1.2 Remote $mysqldump -h 원격 호스트 -u 아이디 -p 데이터베이스명 > 저장 파일명.sql -> $mysqldump -h xxx.xxx.xxx.xxx -u root -p data > sql_dump.sql 1.3 schema $mysqldump -u 아이디 -p -d 데이터베이스명 > 저장 파일명.sql -> $mysqldump -u root -p -d data > sql_dump.sql 2. 특정 테이블 Dump 진행 2.1 Local $mysqldump -u 아이디 -p 데이터베이스명.. 2016. 10. 16.
[MySQL] Unixtime / Date Type(형식) 변경하기 1. 현재시간 Unixtime값 구하기 mysql> select unix_timestamp(); +------------------+ | unix_timestamp() | +------------------+ | 1474073079 | +------------------+ 1 row in set (0.00 sec) 2. Unixtime을 Date형식으로 변환 mysql> select from_unixtime(1474073079); +---------------------------+ | from_unixtime(1474073079) | +---------------------------+ | 2016-09-17 09:44:39 | +---------------------------+ 1 row in se.. 2016. 9. 17.
[MySQL] INET 함수를 이용하여 IP 저장 및 사용법(정수 ↔ IP) 1. INET ATON 함수 - IP 주소를 정수로 변환하는 함수 mysql> SELECT INET_ATON('1.1.1.1'); +----------------------+ | INET_ATON('1.1.1.1') | +----------------------+ | 16843009 | +----------------------+ 1 row in set (0.00 sec) 2. INET NTOA 함수 - 정수를 IP 주소를 변환하는 함수 mysql> SELECT INET_NTOA(16843009); +---------------------+ | INET_NTOA(16843009) | +---------------------+ | 1.1.1.1 | +---------------------+ 1 row in.. 2016. 9. 17.
300x250
300x250

loading