How to remove double slashes from column in MySQL?


Problem :

I have recently found a bug in my website that has been inserting an extra backslash in the URL. I have fixed the bug, but would like to clean up my historical data.

My table name is visits and column name is url. Some of the example URLs in the field are:

www.mysite.com//
www.mysite.com//restaurant/mcdonalds/
www.example.com//

How can I do a find and replace on // to change it to / in MySQL?

I would greatly appreciate any help. Thanks!



Solution :

update visits set url=replace(url, '//', '/');

Mysql Tutorials

Mysql Howto..

Using Visual Studio 2013 with Entity Framework 6 how to use code first with a mySql database

How to connect Mediawiki to a custom user-database?

How to escape apostrophe (') in MySql?

How do you match even numbers of letter or odd numbers of letter using regexp for mysql

How to translate a MySQL database dump to new PG database?

How to filter data in PHP/MySQL by day?

MySQl : How do I use Count on a Sub-Query?

How to get the max of two values in MySQL?

how to do bulk update with from two different tables in two different databases in Azure MySQL DB? [closed]

How can I prevent this script from being freely accessed?

How do I move data from Postgres to MySQL running on Amazon's RDS?

how to check if mysql query return no result(record not found) using php?

How to add column value to SQL LIKE query?

How to calculate or see the performance of my database in mysql?

How to interprete MySQL profile output for tuning external MySQL server

How to find out which operation fired the trigger in MySQL

How to import a mysql backup to mongodb?

how to execute the query that include date function(MySQL)

MySQL - How to store AES_Encrypted data?

Mysql query with left join and show result in html table

how to fast copy a large innodb table

How to access db in vps

How can I convert this working mysql statement to PDO effectively?

PHP/Mysql division returns a float with “comma”, How to return result with a “point”

How to use an user variables in MySQL LIKE clause?

How to pass additional variables to anonymous TableGateway method arguments?

How to fasten join query in mysql

How to keep track of large numbers of A/B and Multivariate experiments for optimizing websites?

How to query MYSQL when clicked?

how would one create a jquery modal dialog pop confirmation box after submission