Thursday, 17 January 2019 .::. Your IP: 54.205.211.87 
Home Tips & Tricks How to Find & Replace in MySQL

How to Find & Replace in MySQL


This tutorial will show you how to find and replace data in MySQL

 

 

 

Firstly you will need to login the mysql command line:

user@Box ~# mysql -u[username] -p[password] -h[hostname] database

Note: The hostname is not needed in the most cases. Also do not split -p and the password. If you do so it will ask you for the password one more time.

 

Now to find and replace the data in MySQL we need to execute the following command:

update [table_name] set [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]');

That's it!
Good luck!

Reddit! Del.icio.us! Mixx! Free and Open Source Software News Google! Facebook! Slashdot! StumbleUpon! TwitThis Joomla Free PHP