Mysql Client Library Mac Os X

Description: I am unable to connect to MySQL server with Workbench 6.3.9, using my Macbook Pro, running OS X (10.12.3). The Hostname, Port and Username is set correctly. I get the following message: Cannot Connect to Database Server Your connection attempt failed for user 'username' from from your host to the server at mysql.mycompany.com:3306: malformed packet I also tried connecting to our. Getting the AMP stack running on OS X Mountain Lion 10.8 i s a little different t han is its predecessor OS X 10.7 Lion, here is the lowdown on getting Apache, MySQL, PHP and phpMyAdmin running on the new Apple operating system. (OSX 10.7 AMP guide is here, and OSX 10.9 Mavericks here). A few years ago we started writing scripts that help install MySQL on OS X. In OS X 10.6 and prior, MySQL was included with the “Server” version of the OS. With the move to Server.app, Apple removed MySQL. Which coincidentally is not long after Oracle acquired Sun which included MySQL. MySQL had a GUI installer for OS X that worked well.

Description: libmysqlclient shipped with MySQL 5.5.8 (and probably before) has incorrect path embedded, which makes programs linked to it to crash on start (as you can see in repeat instructions). MySQL Community Edition is a freely downloadable version of the world's most popular open source database that is supported by an active community of open source developers and enthusiasts. MySQL Cluster Community Edition is available as a separate download. The reason for this change is so that MySQL Cluster can provide more frequent updates.

Description: I am unable to connect to MySQL server with Workbench 6.3.9, using my Macbook Pro, running OS X (10.12.3). The Hostname, Port and Username is set correctly. I get the following message: Cannot Connect to Database Server Your connection attempt failed for user 'username' from from your host to the server at mysql.mycompany.com:3306: malformed packet I also tried connecting to our. I haven't tried -enable-shared on Mac OS X, so I can't promise it will work, but I'm not aware of any reason it wouldn't. In any case, I don't see how this will help you, as your stated goal was to avoid distributing the library.

13 3 likes 52,183 views Last modified Nov 24, 2013 4:14 PM

This User Tip describes how to download, install, and setup MySQL for use on OS X. It includes an optional section for Perl support. Please read through the entire User Tip before starting.


Requirements:

  1. Basic understanding of Terminal.app and how to run command-line programs.
  2. Basic usage of vi. You can substitute nano if you want.
Mysql Client Library Mac Os X

Optional:

Xcode (with command line tools) is required for the MySQL Perl driver.


Lines in bold are what you will have to type in at the Terminal.

Replace <your local host> with the name of your machine. Ideally, it should be a one-word name with no spaces or punctuation. It just makes life easier.

Replace <your short user name> with your short user name.


Download MySQL from a local mirror. You want the Mac OS X ver. 10.6 (x86, 64-bit), DMG Archive. At the time of writing this User Tip, the current version is 5.5.34. By the time you read this, there may be a newer version to use instead. Open the archive mysql-5.5.34-osx10.6-x86_64.dmg.


Install only the mysql-5.5.34-osx10.6-x86_64.pkg package. Ignore everything else.


MySQL comes with a Preference Pane and Startup Item that are based on technologies that Apple deprecated years ago. If you install the Preference Pane or Startup Item, your MySQL installation could fail at some point in the future when Apple removes support for Startup Items. This was reported to MySQL a long time ago. Until MySQL gets around to fixing this bug, we will have to do it ourselves.


Create a launchd config file for MySQL:

sudo vi /Library/LaunchDaemons/com.mysql.mysql.plist


Use the following content:

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE plist PUBLIC '-//Apple//DTD PLIST 1.0//EN' 'http://www.apple.com/DTDs/PropertyList-1.0.dtd'>

<plist version='1.0'>

<dict>

<key>KeepAlive</key>

Best

<true/>

<key>Label</key>

<string>com.mysql.mysqld</string>

<key>ProgramArguments</key>

<array>

<string>/usr/local/mysql/bin/mysqld_safe</string>

<string>--user=mysql</string>

Mac Os X Update

</array>

</dict>

</plist>


(if you are new to vi, type 'i' to enter insert mode. Then ⌘-v to paste the above content. Press escape to get back to command mode. Then type 'ZZ' to save and exit.)

Client


The default path for the MySQL socket is not appropriate for MacOS X. Until it is changed, MySQL will not be able to communicate with PHP should you choose to enable that. Let's fix this now.


Create a config file for MySQL that matches the Apple PHP build:

sudo vi /etc/my.cnf


Use the following content:

[client]

socket=/var/mysql/mysql.sock


[mysqld]

socket=/var/mysql/mysql.sock


Start MySQL:

sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist


MySQL is now up and running. Don't forget to set a root password and configure your users if this is all you need.


If you need to configure Perl support for MySQL, don't setup a root password just yet. Having no password will make testing the Perl module easier. Keep reading...

You will need Xcode and command line tools for this part.


Download the MySQL Perl driver.


Mysql Client Library Mac Os X 10 13 Download

Extract the archive with:

Mysql Client Library Mac Os X 12

tar zxvf DBD-mysql-4.020.tar.gz


Mysql Client Library Mac Os X 10 11

Move into the directory:

cd DBD-mysql-4.020


First, fix the MySQL client library. (credit)


For Lion, type:

sudo install_name_tool -id /usr/local/mysql-5.5.34-osx10.6-x86_64/lib/libmysqlclient.18.dylib /usr/local/mysql-5.5.34-osx10.6-x86_64/lib/libmysqlclient.18.dylib


Next, build DBD::mysql with:

perl Makefile.PL --mysql_config=/usr/local/mysql/bin/mysql_config --testsocket=/var/mysql/mysql.sock --testuser=root

Mysql Client Library Mac Os X 10 7 Download Free

make

make test

sudo make install

Mac Mysql Client Gui



Mysql Client For Macos

Now you can set a root password and configure your users.

Comments are closed.