dump table contents into .log file
Hello. I hope everyone is safe and healthy.
I need to dump the contents of a table in mysql to a .log file so that csf can analyze it and act accordingly but I'm getting the following error. Basically, I simply need to create a cronjob that periodically dumps one table from one database into a .log file.
I've tried without success:
mysqldump --tab=/tmp -u database_name --password='xxxxxxxxx' table_name output.log
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
mysqldump: Got error: 1044: Access denied for user 'database_name'@'localhost' to database 'database_table' when selecting the database
I know I'm using the correct password for the user in the database.
-
You need to use the root login details to dump the database or simply just skip user and password like: mysqldump --tab=/tmp -u database_name table_name output.log 0 -
Thanks @andrew.n This is the error I'm seeing using the suggested method: mysqldump --tab=/tmp -u database_name table_name output.log mysqldump: Got error: 1045: Access denied for user 'database_name'@'localhost' (using password: YES) when trying to connect Error 1045 I believe means I must provide a root password. 0 -
Right, sorry. Could you give this a try? mysqldump database_name table_name > dump.sql 0 -
thanks @andrew.n that works perfectly! Now I need to extract only the part of the output that states: 'invalid login from xxx.xxx.xxx.xxx' where the x's are ip addresses. All of this is to find those offending ip addresses attempting to brute force phplist since phplist has yet to come up to speed with two factor. But thanks for the equation I know that parsing the output is not part of database issues so I can probably get that elsewhere. You have a great day and stay safe! 0 -
Nice collaboration here :D <3 0 -
My pleasure. 0
Please sign in to leave a comment.
Comments
6 comments