Name
mysql_find_rows
Synopsis
mysql_find_rowsoptionsfilename
This utility searches a text file containing SQL statements
(e.g., a dump file generated by mysqldump) for a
given pattern and prints the SQL statements it finds. Multiple files may
be specified in a comma-separated list:
mysql_find_rows --regexp='Graham Greene' < backup.sql > greene_sql_ statements.txt
In this example, the utility will search the dump file
backup.sql (the redirect for the input is optional)
for occurrences of the name of the writer Graham
Greene. It will write the
results—the SQL statements it finds that contain that text—to
the greene_sql_statements.txt
file because of the redirect (i.e., >). Otherwise,
the results would be displayed on the screen. When creating a dump file
that you want to search with this utility, you may want to avoid the
--extended-insert option (or use
--skip-opt to disable it) because that option leaves
a single INSERT statement in the dump file for all
rows in the entire table. Your search with this utility would then show
all rows for the table, as it returns the whole SQL statement containing
the search pattern.
mysql_find_rows options
--helpThis option displays help information about the utility.
--regexp=patternThis option specifies the pattern on which the utility is to search the given text file. The pattern is usually entered between quotes. If the option is not given, then the utility will search for
SETandUSEstatements.--rows=numberThis option limits the number of rows of ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access