mysql批量修改http为https,搜索和将数据库中的“ http”替换为“ https”
Using phpmyadmin, I want to run a query that will search my entire database for:
http://example.com
And replace with:
https://example.com
My SQL knowledge is limited, maybe something like:
UPDATE ?? = REPLACE(??, 'http://example.com', 'https://example.com');
The database is over 1gb, so what can I run that will not crash the server.
Update: Note that while there are other answers posted here on SO that deals with search and replace, they don't seem to cover the entire database.
解决方案
use REPLACE. and if there is a index on the field then the UPDATE can use them
UPDATE t
set url = REPLACE(url, 'http:', 'https:')
WHERE url LIKE '%http:%';
only change example.com
this will only find row with 'http://example.com'
UPDATE t
set url = REPLACE(url, 'http:', 'https:')
WHERE url LIKE '%http://example.com%';
or this will find all rows with http:// but only change only this http://example.com to https://example.com
UPDATE t
set url = REPLACE(url, 'http://example.com', 'https://example.com')
WHERE url LIKE '%http:%';
mysql批量修改http为https,搜索和将数据库中的“ http”替换为“ https”相关推荐
- mysql 批量修改
mysql更新语句很简单,更新一条数据的某个字段,一般这样写: UPDATE mytable SET myfield = 'value' WHERE other_field = 'other_valu ...
- MySQL 批量修改表名
MySQL 批量修改表名 1.执行查询SQL 2.执行修改SQL 功能: 将数据库 jeecg-boot 中的表名前缀是 ACT_ 开头的表名替换为 CAMUNDA_ACT_ 1.执行查询SQL -- ...
- mysql批量修改表字段类型(生成修改sql)
文章目录 >实例 需求 解决方案 >详解 问题 1.查出所需要的列名 2.确定修改SQL 3.通过CONCAT函数批量生成修改SQL 4.执行生成的sql 注意 >实例 需求 已知, ...
- mysql批量修改表名、删除表
mysql批量修改表名 第一步:得到所有需要修改的表名和对于得修改表名语句 SELECT CONCAT( 'ALTER TABLE ', table_name, ' RENAME TO ', REPL ...
- mysql升级后将旧数据迁移到新 数据库中
mysql升级后将旧数据迁移到新 数据库中 1.将原来数据库进行导出成.sql文件 例:StudentSql.sql 2.进入新数据库的bin目录下 复制bin目录 3.cmd进入bin目录下(需管理 ...
- mysql批量修改字段字符集_MySQL字符集修改实战教程
前言: 在 MySQL 中,系统支持诸多字符集,不同字符集之间也略有区别.目前最常用的字符集应该是 utf8 和 utf8mb4 了,相比于 utf8 ,utf8mb4 支持存储 emoji 表情,使 ...
- MySQL 批量修改数据库的字符集和排序规则
推荐阅读 Helm3(K8S 资源对象管理工具)视频教程:https://edu.csdn.net/course/detail/32506 Helm3(K8S 资源对象管理工具)博客专栏:https: ...
- mysql批量修改表字段信息,把mysql中列名大写字母列转化为小写
方法:通过sql语句拼凑出可执行的sql语句 把mysql中列名大写字母列转化为小写的sql SELECTconcat( 'alter table ', TABLE_NAME, ' change co ...
- mysql批量修改表名前缀
mysql中修改表名前缀的语句为:alert table 旧表名 rename to 新表名: mysql没有直接批量修改表名的方法,但是我们可以通过批量生成修改语句来达到批量修改表名的效果. 代码: ...
最新文章
- jquery treeview 树形插件
- Spring3.x事务失效的原因以及解决办法
- maven hibernat mysql_手把手教你用 maven 搭建 SSH (struts2 +hibernate5 + spring5) 项目
- 去掉一个linux的ip,linux – iptables删除除一个IP之外的所有传入ICMP请求
- 常见的数据结构——栈、队列、数组、链表和红黑树
- 一个用于分页的page类
- python创建实例时显示没有参数-OSError无法创建文件无效参数
- SI4463模块配合WDS的快速上手指南
- mysql8.0创建属性_MySQL8.0新特性——资源管理
- 世界公认的第一商人——成就犹太商人的15个信条
- BCB Victor 串口 VCL 控件,YbCommDevice1通过单片机接收多字节字符串
- Java学习笔记之---集合
- tensorflow 1.14 + cuda10.1 在Ubuntu 16.04上
- 计算机信息安全技术 学习笔记
- Apple Pay接入详细教程
- TPC,TPCC,TPMC(计算机性能衡量指标)
- 技术停滞:如何更新?
- android material design主题在线配色
- 从苏宁电器到卡巴斯基(第二部)第27篇:我当高校教师的这几年 III
- 台灯是白炽灯好,是LED护眼灯好?推荐对眼睛舒适的护眼台灯