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"
I am trying to return all the rows where the column datetime
is like 2014-09
meaning "all September rows".
If mysqldump is not identified by the cmd prompt that means it cannot recognize where the mysqldump.exe is located. You need to add path of the directory where the exe is located in the PATH variable under environment variables. After doing that your command will start working in the cmd prompt.
The mysqldump tool is located in the root/bin directory of the MySQL installation directory.
By default, mysqldump locks all the tables it's about to dump. This ensure the data is in a consistent state during the dump.
mysqldump requires at least the SELECT privilege for dumped tables, SHOW VIEW for dumped views, TRIGGER for dumped triggers, LOCK TABLES if the --single-transaction option is not used, and (as of MySQL 8.0.21) PROCESS if the --no-tablespaces option is not used.
You may need to use quotes:
mysqldump -t -u root -p mytestdb mytable --where="datetime LIKE '2014-09%'"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With