# Percona toolkit - Unable to connect to Mysqldb - MAC

**URL:** <https://forums.percona.com/t/percona-toolkit-unable-to-connect-to-mysqldb-mac/30812>\
**Category:** Uncategorized\
**Created:** [June 4, 2024, 2:56pm UTC](https://forums.percona.com/t/percona-toolkit-unable-to-connect-to-mysqldb-mac/30812 "2024-06-04T14:56:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mysqlcoe](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@mysqlcoe](https://forums.percona.com/u/mysqlcoe)\
**Post date:** [June 4, 2024, 2:56pm UTC](https://forums.percona.com/t/percona-toolkit-unable-to-connect-to-mysqldb-mac/30812/1 "2024-06-04T14:56:15Z")

</div>

Hi,

I am unable to run percona toolkit in mac. I am getting the following error.

Cannot connect to MySQL: Cannot connect to MySQL because the Perl DBD::mysql module is not installed or not found. Run ‘perl -MDBD::mysql’ to see the directories that Perl searches for DBD::mysql. If DBD::mysql is not installed, try:  
Debian/Ubuntu apt-get install libdbd-mysql-perl  
RHEL/CentOS yum install perl-DBD-MySQL  
OpenSolaris pgk install pkg:/SUNWapu13dbd-mysql  
18 at ./pt-online-schema-change line 8758.

Need help.

---

<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:** [June 4, 2024, 3:44pm UTC](https://forums.percona.com/t/percona-toolkit-unable-to-connect-to-mysqldb-mac/30812/2 "2024-06-04T15:44:23Z")

</div>

I ran the following on my mac and the toolkit is able to connect to a remote MySQL server:

```auto
$ brew install percona-toolkit
$ brew install mysql-client
$ brew link --force mysql-client
$ pt-mysql-summary -h 10.10.10.203 -P 8035 --user msandbox --password msandbox
...
# Report On Port 8035 ########################################
                     User | msandbox@%
                     Time | 2024-06-04 15:42:54 (UTC)
                 Hostname | remotedblion
                  Version | 8.0.35-27 Percona Server (GPL), Release 27, Revision 2f8eeab2

```

---

<div class="post-metadata">

**Author:** ![mysqlcoe](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@mysqlcoe](https://forums.percona.com/u/mysqlcoe)\
**Post date:** [June 4, 2024, 5:20pm UTC](https://forums.percona.com/t/percona-toolkit-unable-to-connect-to-mysqldb-mac/30812/3 "2024-06-04T17:20:16Z")

</div>

Thanks, Matt! I am able to get pt-mysql-summary work. But the pt-online-schema-change errors. Is pt-online-schema-changes working for you?

Thanks!

---

<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:** [June 4, 2024, 5:28pm UTC](https://forums.percona.com/t/percona-toolkit-unable-to-connect-to-mysqldb-mac/30812/4 "2024-06-04T17:28:05Z")

</div>

Can you show the errors? It’s hard to help without seeing what you are seeing.

---

<div class="post-metadata">

**Author:** ![mysqlcoe](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@mysqlcoe](https://forums.percona.com/u/mysqlcoe)\
**Post date:** [June 4, 2024, 5:31pm UTC](https://forums.percona.com/t/percona-toolkit-unable-to-connect-to-mysqldb-mac/30812/5 "2024-06-04T17:31:50Z")

</div>

Cannot connect to MySQL: Cannot connect to MySQL because the Perl DBD::mysql module is not installed or not found. Run ‘perl -MDBD::mysql’ to see the directories that Perl searches for DBD::mysql. If DBD::mysql is not installed, try:  
Debian/Ubuntu apt-get install libdbd-mysql-perl  
RHEL/CentOS yum install perl-DBD-MySQL  
OpenSolaris pgk install pkg:/SUNWapu13dbd-mysql  
18 at ./pt-online-schema-change line 8758.

---

<div class="post-metadata">

**Author:** ![mysqlcoe](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@mysqlcoe](https://forums.percona.com/u/mysqlcoe)\
**Post date:** [June 4, 2024, 10:25pm UTC](https://forums.percona.com/t/percona-toolkit-unable-to-connect-to-mysqldb-mac/30812/6 "2024-06-04T22:25:47Z")

</div>

Any help with this please

---

<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:** [June 5, 2024, 12:56am UTC](https://forums.percona.com/t/percona-toolkit-unable-to-connect-to-mysqldb-mac/30812/7 "2024-06-05T00:56:57Z")

</div>

Hello @mysqlcoe The forums are a volunteer effort from Percona employees and community members. If you need immediate help, you can engage us with a support contract.

I had no issues running pt-osc on my mac:

```auto
$ sw_vers
ProductName: macOS
ProductVersion: 13.6.7
BuildVersion: 22G720

$ pt-online-schema-change --version
pt-online-schema-change 3.5.5

$ pt-online-schema-change -h 10.10.10.203 --user msandbox --password msandbox D=world,t=city,P=8035 --alter "ADD COLUMN c13 varchar(20)" --execute
No slaves found. See --recursion-method if host blacklion has slaves.
Not checking slave lag because no slaves were found and --check-slave-lag was not specified.
Operation, tries, wait:
  analyze_table, 10, 1
  copy_rows, 10, 0.25
  create_triggers, 10, 1
  drop_triggers, 10, 1
  swap_tables, 10, 1
  update_foreign_keys, 10, 1
Altering `world`.`city`...
Creating new table...
Created new table world._city_new OK.
Altering new table...
Altered `world`.`_city_new` OK.
2024-06-04T19:53:17 Creating triggers...
2024-06-04T19:53:17 Created triggers OK.
2024-06-04T19:53:17 Copying approximately 4046 rows...
2024-06-04T19:53:17 Copied rows OK.
2024-06-04T19:53:17 Analyzing new table...
2024-06-04T19:53:17 Swapping tables...
2024-06-04T19:53:17 Swapped original and new tables OK.
2024-06-04T19:53:17 Dropping old table...
2024-06-04T19:53:17 Dropped old table `world`.`_city_old` OK.
2024-06-04T19:53:17 Dropping triggers...
2024-06-04T19:53:17 Dropped triggers OK.
Successfully altered `world`.`city`.

```
