{"id":17993882,"url":"https://github.com/timandy/mysqlsed","last_synced_at":"2025-04-04T05:13:52.524Z","repository":{"id":200683183,"uuid":"706021537","full_name":"timandy/mysqlsed","owner":"timandy","description":"database keyword replace","archived":false,"fork":false,"pushed_at":"2024-02-20T06:31:59.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-09T16:40:51.461Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timandy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-17T06:44:24.000Z","updated_at":"2024-11-21T07:36:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"1382704e-fb1c-4cd2-9b7e-9a0fb80696da","html_url":"https://github.com/timandy/mysqlsed","commit_stats":null,"previous_names":["timandy/mysqlsed"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timandy%2Fmysqlsed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timandy%2Fmysqlsed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timandy%2Fmysqlsed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timandy%2Fmysqlsed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timandy","download_url":"https://codeload.github.com/timandy/mysqlsed/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247123087,"owners_count":20887261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-29T20:13:21.133Z","updated_at":"2025-04-04T05:13:52.508Z","avatar_url":"https://github.com/timandy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mysql 脚本处理工具\n\n`mysqlsed` 是一个 sql 文件处理工具，一般用于整库关键字替换。\n\n`mysqlsed` 首先逐行分析每一条语句，只有插入语句才进入后续处理，判断该行包含指定的关键字进行替换，并将插入语句转换为更新语句，然后写入到 `out.sql` 文件。\n\n操作步骤：\n\n1. 导出整个数据库为 sql 文件，导出的数据为一行行的 insert 脚本。\n\n```shell\nmysqldump -h {HOST} -P {PORT} -u{USER} -p{PASSWORD} \\\n--default-character-set=utf8mb4 \\\n--hex-blob \\\n--routines \\\n--skip-extended-insert \\\n--skip-add-drop-table \\\n--skip-create-options \\\n--set-gtid-purged=OFF \\\n{DB} \u003e {DB}.sql\n```\n\n2. 使用 mysqlsed 处理文件。\n\n```shell\nmysqlsed {DB}.sql [Keyword\u003e\u003e\u003eTargetWord] [Keyword\u003e\u003e\u003eTargetWord] ...\n```\n\n替换后将会生成 `out.sql` 文件。\n\n3. 将 `out.sql` 在原来的数据库上执行。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimandy%2Fmysqlsed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimandy%2Fmysqlsed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimandy%2Fmysqlsed/lists"}