«   2018/08   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Archives
Today
115
Total
1,140,623
안정적인 DNS서비스 DNSEver
관리 메뉴

Blue Breeze

mysql cmd query 본문

DB&NoSQL/MySQL\MariaDB

mysql cmd query

푸른바람 C/H 2017.04.20 08:30

mysql -u user -p PASSWORD -e 'Execute sql query' database_name
mysql -uUESRNAME -pPASSWORD -h MYSQLSERVERNAME --port=3306 -e 'show tables;' database_name

+-----------------------------+
| Tables_in_database_name     |
+-----------------------------+
| access_keys                 |
+-----------------------------+


mysqldump -uUESRNAME -pPASSWORD DATABASE_NAME TABLE_NAME -C --where='created < "2017-01-01"' > DATABASE.TABLE.20170101.sql
mysqldump -uUESRNAME -pPASSWORD DATABASE_NAME TABLE_NAME -C --where='created < "2017-01-01"' | gzip > DATABASE.TABLE.20170101.sql.gz


0 Comments
댓글쓰기 폼