Monday, 23 January 2023

Python - How to check is MySQL client is configured/ installed

To check you have MySQLdb installed on your machine. 

#!/usr/bin/python

import MySQLdb

If the execution is success, then already installed.

If not, it will throw the below error,

Traceback (most recent call last):
   File "test.py", line 3, in <module>
      import MySQLdb
ImportError: No module named MySQLdb

 

No comments:

Data Sharing

  1. Create Share CREATE SHARE my_share; 2. Grant privileges to share GRANT USAGE ON DATABASE my_db TO SHARE my_share; GRANT USAGE ...