UPDATE  `MySQL_Table` SET  `MySQL_Table_Column` = REPLACE(`MySQL_Table_Column`, 'oldString', 'newString') WHERE  `MySQL_Table_Column` LIKE 'oldString%';

When Should I use MySQL Search and Replace?

Doing a Search and Replace via SQL could be dangerous if you have links that you’re unaware of which shouldn’t be changed. You should Search and Replace only when you’re convinced that you have to change the text in your Database. You should always perform a Database backup before proceeding with any manual changes.

How can I import a database with MySQL from terminal?

Prompt for password:

 mysql -u username -p databasename < filename.sql  

Enter password directly (not secure):

 mysql -u username -pPlainPassword databasename filename.sql 


mysql -u root -p wp_users < wp_users.sql

mysql -u root -pPassword123 wp_users --default-character-set=utf8 < wp_users.sql

See also: Executing SQL Statements from a Text File