mysql_find_rows
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.
--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 SET and USE
statements.
--rows=numberThis option limits the number of rows of the results. It will return the first rows that it finds, up to the number given.
--skip-use-dbThis option instructs the utility not to search for
USE statements, which it searches for by
default.
--start_row=numberThis option returns rows starting after the given number of rows.