2017 © Pedro Peláez
 

library mysql-find-and-replace

Find and replace tool for MySQL

image

mamchenkov/mysql-find-and-replace

Find and replace tool for MySQL

  • Sunday, October 19, 2014
  • by mamchenkov
  • Repository
  • 1 Watchers
  • 2 Stars
  • 83 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

MySQL find and replace

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., (*1)


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., (*2)

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:, (*3)

http://davidcoveney.com/782/mysql-database-search-replace-with-serialized-php/, (*4)

My changes so far are:, (*5)

  • 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:, (*6)

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

Usage

Always, always, always backup your database before usage:, (*7)

$ mysqldump test_db > test_db.backup.sql

Run the script like so:, (*8)

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

The Versions

19/10 2014

dev-master

9999999-dev https://github.com/mamchenkov/MySQL-FindAndReplace

Find and replace tool for MySQL

  Sources   Download

GPL-2.0

The Requires

  • php >=5.3.0
  • ext-mysqli *

 

database strings mysql find-replace

19/10 2014

v1.0.1

1.0.1.0 https://github.com/mamchenkov/MySQL-FindAndReplace

Find and replace tool for MySQL

  Sources   Download

GPL-2.0

The Requires

  • php >=5.3.0
  • ext-mysqli *

 

database strings mysql find-replace

10/10 2014

v1.0.0

1.0.0.0 https://github.com/mamchenkov/MySQL-FindAndReplace

Find and replace tool for MySQL

  Sources   Download

GPL-2.0

The Requires

  • php >=5.3.0
  • ext-mysqli *

 

database strings mysql find-replace