mysqldump with --where clause is not working
mysqldump -t -u root -p mytestdb mytable --where=datetime LIKE '2014-09%'
This is what I am doing and it returns:
mysqldump: Couldn't find table: "LIKE"
열이 있는 모든 행을 반환하려고 합니다.datetime
가like 2014-09
"9월의 모든 행"을 의미합니다.
You may need to use quotes:
mysqldump -t -u root -p mytestdb mytable --where="datetime LIKE '2014-09%'"
Selecting dates using LIKE is not a good idea. I saw this method in one project. This causes huge DBMS load and slow system operation as no index by this table column used.
If you need to select date range use between:
where datetime between '2014-09-01' and '2014-09-30 23:59:59'
사용할 때 답변이 아니라 공지사항일 뿐입니다.mysqldump
자동으로 추가됩니다.DROP TABLE
그리고.CREATE TABLE
내보내기 파일에 추가를 원하지 않는 경우--skip-add-drop-table
그리고.--no-create-info
다음과 같은 명령을 받습니다.
mysqldump -u root-p database_name table_name --skip-add-drop-table --no-create-info > export.sql
You missed "" for where clause . datetime column name datetime is not recommended. It is a data type as well.
mysqldump -u root -p mytestdb mytable --where="datetime LIKE '2014-09%'
" > mytable.sql;
After executing the command a prompt will ask for MySQL password. then check your current folder for generated mystable.sql
ReferenceURL : https://stackoverflow.com/questions/26261670/mysqldump-with-where-clause-is-not-working
'programing' 카테고리의 다른 글
:hover와 결합 후 :fir (0) | 2023.09.19 |
---|---|
MySQL: 한 테이블에서 레코드 수를 세고 다른 테이블 업데이트 (0) | 2023.09.19 |
리소스 ID에서 리소스 이름을 가져오는 방법 (0) | 2023.09.19 |
Oracle에서 인덱스가 클러스터된 것입니까 아니면 클러스터되지 않은 것입니까? (0) | 2023.09.19 |
WP 플러그인 업그레이드 후 Google Maps API V3 오류 발생 (0) | 2023.09.19 |