PHPackages                             mamchenkov/mysql-find-and-replace - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. mamchenkov/mysql-find-and-replace

ActiveLibrary[Database &amp; ORM](/categories/database)

mamchenkov/mysql-find-and-replace
=================================

Find and replace tool for MySQL

v1.0.1(11y ago)3921[1 issues](https://github.com/mamchenkov/MySQL-FindAndReplace/issues)GPL-2.0PHPPHP &gt;=5.3.0

Since Oct 10Pushed 11y ago1 watchersCompare

[ Source](https://github.com/mamchenkov/MySQL-FindAndReplace)[ Packagist](https://packagist.org/packages/mamchenkov/mysql-find-and-replace)[ Docs](https://github.com/mamchenkov/MySQL-FindAndReplace)[ RSS](/packages/mamchenkov-mysql-find-and-replace/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

MySQL find and replace
======================

[](#mysql-find-and-replace)

**NOTE** There is a better way now - use [interconnectit/Search-Replace-DB](https://github.com/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:

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)

Install with composer like so:

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

```

Usage
-----

[](#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

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~9 days

Total

2

Last Release

4220d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3cf6df002a284d78fb6e9d8222ca4d102e0832035ed6bc8447008bd234e131a4?d=identicon)[mamchenkov](/maintainers/mamchenkov)

---

Top Contributors

[![mamchenkov](https://avatars.githubusercontent.com/u/437928?v=4)](https://github.com/mamchenkov "mamchenkov (24 commits)")

---

Tags

clicomposermysqlphpdatabasemysqlstringsfind-replace

### Embed Badge

![Health badge](/badges/mamchenkov-mysql-find-and-replace/health.svg)

```
[![Health](https://phpackages.com/badges/mamchenkov-mysql-find-and-replace/health.svg)](https://phpackages.com/packages/mamchenkov-mysql-find-and-replace)
```

###  Alternatives

[rah/danpu

Zero-dependency MySQL dump library for easily exporting and importing databases

64401.8k10](/packages/rah-danpu)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
