定制 mamchenkov/mysql-find-and-replace 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mamchenkov/mysql-find-and-replace

Composer 安装命令:

composer require mamchenkov/mysql-find-and-replace

包简介

Find and replace tool for MySQL

README 文档

README

NOTE There is a better way now - use interconnectit/Search-Replace-DB. It has verbosity control, collation converter and works both with command line and web interface. It's just better.

This script performs a find and replace operation across all fields, of all tables in a specified MySQL database. On top of regular fields, it also processes serialized values.

This code is heavily based on MySQL search and replace script written by David Coveney, and he deserves all the credit. The original script is here:

http://davidcoveney.com/782/mysql-database-search-replace-with-serialized-php/

My changes so far are:

  • CLI, not web based. In the future, it will support both environments.
  • Fail on any MySQL error. Original code was just printing out the message.
  • Run-time configuration through CLI options
  • Lots of coding style changes (work in progress).
  • Composer installer

Install

Install with composer like so:

{
	"require": {
		"mamchenkov/mysql-find-and-replace": "1.0.*"
	}
}

Usage

Always, always, always backup your database before usage:

$ mysqldump test_db > test_db.backup.sql

Run the script like so:

$ ./bin/mysql-replace.php database=test_db find=foo replace=bar

统计信息

  • 总下载量: 92
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2014-10-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固