Ruchika
Ruchika

Reputation: 515

replace http in phpmyadmin database to https

I am trying to replace in all http in database with https Using below code in phpmyadmin but showing syntax error, can anyone guide how to do.

Code

UPDATE mytable_rsseo_redirects SET to = replace(to, 'http', 'https');

enter image description here

Upvotes: 0

Views: 2480

Answers (1)

user149341
user149341

Reputation:

to is a MySQL reserved word, making it a poor choice of column name. (The same applies to from.)

Since it's a reserved word, it must be surrounded in backticks:

UPDATE `mytable_rsseo_redirects` SET `to` = REPLACE(`to`, 'http', 'https');

Upvotes: 4

Related Questions