A comprehensive installation guide for MySQL and MySQLClient(Python) in MacOS which actually works!!
Hive is a data warehouse tool based on Hadoop for data extraction, transformation, and loading. This is a mechanism that can store, query, and analyze large-scale data stored in Hadoop. In this article, I will take you through How to Install Hive on Mac with Homebrew using Terminal.
Connecting to MySQL from Python in MacOS is a very problematic and painful process. In this post, we are going to see how to install MySQL and connect a Python application to it using mysqlclient.
You need to install Homebrew in you local machine. You can do it by:
Using Homebrew you can install mysql simply by:
Then setup the credentials in MySQL server using the following command:
Finally if you want to start at login and as a background service, run this:
For connecting any other application to MySQL, you need to install a connector. You can do it like this:
You can do this by:
Please run the following command:
Then add its path to environment using following line:
You need to unlink mysql and link mysql-connector-c:
You should be able to use
pip install mysqlclient without any errors.
Now, you need to do the opposite of Step six:
mysqlclient should work fine and will have no problem connecting your application from mysql to python.
if you have mysqlclient installed in the system, then you can use
--system-site-packages when creating virtual environment:
But, if you do not want to include all the system packages, and you still face error installing
mysqlclient in virtual environment, then try following steps:
In this article, we have seen installing MySQL from Homebrew. I never used MySQL installed from Oracle website, so don’t know how to fix it. Better if you uninstall that and install MySQL from scratch using Homebrew.
Last updated: Jul 19, 2021