MySQL Forums
Forum List  »  Newbie

How to mysqldump of table with where condition for all data older than a certain epochtime value
Posted by: Dieter Schneider
Date: August 06, 2016 06:02AM

I have problems to automate my database backup by a powershell. I want to export every day all records in a special table which are older (or better greater than >=) than a certain defined value for a Epoch Time.

My table looks like this structure:

mysql> show columns from generalhistory;
+-----------+--------------+------+-----+-------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+-------------------+----------------+
| ID | int(11) | NO | PRI | NULL | auto_increment |
| DPName | varchar(100) | NO | | NULL | |
| Value | varchar(100) | NO | | NULL | |
| Timestamp | timestamp | NO | | CURRENT_TIMESTAMP | |
| Manager | varchar(100) | NO | | NULL | |
| EpochTime | bigint(20) | NO | | NULL | |
+-----------+--------------+------+-----+-------------------+----------------+
here are my command which i try to execute in a powershell windows but there will nothing be exported from the data.

PS D:\xampp\mysql\bin> .\mysqldump.exe --no-create-db --no-create-info --skip-triggers -u root -pmypassword homescada generalhistory --where="EpochTime > '1470268800975'"
I also tried this solution but also without success.

PS D:\xampp\mysql\bin> .\mysqldump.exe --no-create-db --no-create-info --skip-triggers -u root -pmypassword homescada generalhistory --where="'Timestamp' BETWEEN '2016-06-11 09:26:01' AND '2016-08-05 09:26:01'"
do you knwo what i do wrong?#

many thanks

dieter

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.