# Percona-toolkit seems incompatible with mac os sonoma

**URL:** <https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118>\
**Category:** Other MySQL® Questions\
**Tags:** percona\
**Created:** [October 23, 2023, 2:39pm UTC](https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118 "2023-10-23T14:39:50Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidenglish](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@davidenglish](https://forums.percona.com/u/davidenglish)\
**Post date:** [October 23, 2023, 2:39pm UTC](https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118/1 "2023-10-23T14:39:50Z")

</div>

I am using percona-toolkit 3.5.5 but having updated to mac os sonoma, running `pt-online-schema-change` produces the following error message:

`DBI.c: loadable library and perl binaries are mismatched (got handshake key 0xc700080, needed 0xfb80080)`

I am using the version of Perl (5.30.3) that is bundled with mac os. I tried the more updated version of perl offered by homebrew (5.38.0) but get the same error message.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [October 23, 2023, 3:42pm UTC](https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118/2 "2023-10-23T15:42:12Z")

</div>

Did you also install/update the latest DBD/DBI?

---

<div class="post-metadata">

**Author:** ![davidenglish](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@davidenglish](https://forums.percona.com/u/davidenglish)\
**Post date:** [October 23, 2023, 4:05pm UTC](https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118/3 "2023-10-23T16:05:18Z")

</div>

I didn’t actively update DBI but it seems to be the latest:  
`cpan -D DBI` =\> 1.643

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [October 23, 2023, 4:27pm UTC](https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118/4 "2023-10-23T16:27:09Z")

</div>

And DBD::mysql? I know there is a newer version in the Percona tools repo that is usually later than most distros.

---

<div class="post-metadata">

**Author:** ![davidenglish](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@davidenglish](https://forums.percona.com/u/davidenglish)\
**Post date:** [October 24, 2023, 1:55am UTC](https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118/5 "2023-10-24T01:55:23Z")

</div>

Thanks matthewb for your help.

DBD::mysql is not installed so that could be the issue. The install fails both on the system version of perl and an perl install from homebrew. I have tried to use perlbrew but running the install of a perl version also fails.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [October 24, 2023, 4:47am UTC](https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118/6 "2023-10-24T04:47:49Z")

</div>

Are you on M1/M2 mac? You might have issues compiling for ARM processors.

---

<div class="post-metadata">

**Author:** ![davidenglish](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@davidenglish](https://forums.percona.com/u/davidenglish)\
**Post date:** [October 24, 2023, 11:42am UTC](https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118/7 "2023-10-24T11:42:30Z")

</div>

I am using an M1. I have another linux box where everything is running smoothly.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [October 24, 2023, 3:11pm UTC](https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118/8 "2023-10-24T15:11:46Z")

</div>

You are not the first person who has had issues, in general, with M1/M2 macs and getting software working on them. My co-worker cannot use terraform, for example, because he has an M2 mac and the terraform won’t compile. I’m on an x86 mac and everything works 🙂

---

<div class="post-metadata">

**Author:** ![wwinningham](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/wwinningham/32/13496_2.png) [@wwinningham](https://forums.percona.com/u/wwinningham)\
**Post date:** [October 24, 2023, 7:48pm UTC](https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118/9 "2023-10-24T19:48:32Z")

</div>

I’ve been on an Apple Silicon machine for over a year and just started running into this error over the past week. So it did work.

Attempting to `cpan install DBD::mysql` gives me the following error which could be the root of the error reported here.

./dbdimp.h:20:10: fatal error: ‘DBIXS.h’ file not found

---

<div class="post-metadata">

**Author:** ![bassguitarbill](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/bassguitarbill/32/13513_2.png) [@bassguitarbill](https://forums.percona.com/u/bassguitarbill)\
**Post date:** [October 25, 2023, 12:35pm UTC](https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118/10 "2023-10-25T12:35:21Z")

</div>

I am having this issue, but I found a workaround. I’m using homebrew’s perl 5.38, and /usr/bin/perl is 5.30. `$ which pt-online-schema-change` led me to a file in /opt/homebrew/bin, which calls `/opt/homebrew/Cellar/percona-toolkit/3.5.5/libexec/bin/pt-online-schema-change`. This file had a shebang of `#!/usr/bin/perl5.34`; I changed it to `#!/usr/bin/perl` and now I am able to run `pt-online-schema-change` successfully.

I’m not an expert on homebrew by any means, but in the formula there is a [call to rewrite\_shebang](https://github.com/Homebrew/homebrew-core/blob/43e1da79af2dd55d9268af8ffbf7a51ba47be3b5/Formula/p/percona-toolkit.rb#L78) that might be misbehaving.

---

<div class="post-metadata">

**Author:** ![davidenglish](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@davidenglish](https://forums.percona.com/u/davidenglish)\
**Post date:** [October 26, 2023, 1:15pm UTC](https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118/11 "2023-10-26T13:15:22Z")

</div>

Thank you bassguitarbill. I held off to see if sonoma 14.1 would provide a fix but it did not. Your tweak to the shebang resolved it.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [October 26, 2023, 3:39pm UTC](https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118/12 "2023-10-26T15:39:36Z")

</div>

@wwinningham Did you see @bassguitarbill fix above? Does something similar affect you?

Homebrew it outside Percona’s jurisdiction, so any fixes would need to be created and submitted to the Homebrew team.

---

<div class="post-metadata">

**Author:** ![svetasmirnova](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/svetasmirnova/32/21_2.png) [@svetasmirnova](https://forums.percona.com/u/svetasmirnova)\
**Post date:** [November 7, 2023, 11:50am UTC](https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118/13 "2023-11-07T11:50:12Z")

</div>

> Thank you bassguitarbill. I held off to see if sonoma 14.1 would provide a fix but it did not. Your tweak to the shebang resolved it.

We do not put `#!/usr/bin/perl5.34` into our tools code. Did you install Percona Toolkit from homebrew? Can you try with Percona generic packages (tar.gz) and let us know if tools work?

---

<div class="post-metadata">

**Author:** ![wwinningham](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/wwinningham/32/13496_2.png) [@wwinningham](https://forums.percona.com/u/wwinningham)\
**Post date:** [November 7, 2023, 1:14pm UTC](https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118/14 "2023-11-07T13:14:55Z")

</div>

Worked for me and everyone else at my company, too.

---

<div class="post-metadata">

**Author:** ![bassguitarbill](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/bassguitarbill/32/13513_2.png) [@bassguitarbill](https://forums.percona.com/u/bassguitarbill)\
**Post date:** [November 7, 2023, 1:53pm UTC](https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118/15 "2023-11-07T13:53:12Z")

</div>

I can confirm that the “Generic Linux” version of percona-toolkit works fine; the shebang is `#!/usr/bin/env perl`. I’m pretty confident that this is an issue with the Homebrew formula, but the code in that formula that mangles the shebang was added intentionally to fix another issue, so I assume it won’t be a trivial fix.

---

<div class="post-metadata">

**Author:** ![svetasmirnova](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/svetasmirnova/32/21_2.png) [@svetasmirnova](https://forums.percona.com/u/svetasmirnova)\
**Post date:** [November 8, 2023, 3:37pm UTC](https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118/16 "2023-11-08T15:37:23Z")

</div>

Thank you for the test! Please use this workaround for now. We do not officially support MacOS but we will try to figure out what is wrong ourselves too.

---

<div class="post-metadata">

**Author:** ![svetasmirnova](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/svetasmirnova/32/21_2.png) [@svetasmirnova](https://forums.percona.com/u/svetasmirnova)\
**Post date:** [November 10, 2023, 11:54am UTC](https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118/17 "2023-11-10T11:54:06Z")

</div>

I believe shebang, specific to Perl version, was introduced as part of fix for [Perl upgrade to 5.34.0 breaks cpan: loadable library and perl binaries are mismatched · Issue #77797 · Homebrew/homebrew-core · GitHub](https://github.com/Homebrew/homebrew-core/issues/77797). This is kind of generic patch, not related to Percona Toolkit. It should be safe to use the Percona Toolkit with either Perl 5.30 or 5.38, so you can safely change shebang to #!/usr/bin/perl

---

<div class="post-metadata">

**Author:** ![svetasmirnova](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/svetasmirnova/32/21_2.png) [@svetasmirnova](https://forums.percona.com/u/svetasmirnova)\
**Post date:** [November 14, 2023, 10:23am UTC](https://forums.percona.com/t/percona-toolkit-seems-incompatible-with-mac-os-sonoma/26118/18 "2023-11-14T10:23:12Z")

</div>

The issue is fixed. See [Percona Toolkit fails on macOS 10.4 due to #!/usr/bin/perl5.34 shebang · Issue #154201 · Homebrew/homebrew-core · GitHub](https://github.com/Homebrew/homebrew-core/issues/154201)
