I want to connect my MYSQL DB to the python DB.I have installed pip mysql connector already.I opened pycharm and ran "import mysql.connector". Upon executing this code,I received 'no such module named mysql' error.
import mysql.connector
I want to connect my MYSQL DB to the python DB.I have installed pip mysql connector already.I opened pycharm and ran "import mysql.connector". Upon executing this code,I received 'no such module named mysql' error.
import mysql.connector
I don't know what you have tried so far, so I'm not sure if this will solve your problem but check your configuration.
Also, I'm not quite sure what PyCharm 3.7 is? Did you mean Python 3.7 and PyCharm 2019? (For this answer, I'm using PyCharm Professional 2019 and Python 3.6
First check your current interpreter. It can be found on the right side of your windows, bottom corner.

Open Interpreter Settings. A window with a list will pop up, showing the currently install packages. Start typing the name of your package you are looking for. If it's not found, you must install it.

For installing, click on the small plus-Sign on right of the list. The window called Available Packages will appear. Here search for your desired package. 
Click on Install Packages
Check your configuration:
Under Run -> Edit Configurations (or the Dropdown menu near the Run-Button) make sure you have selected the right Python interpreter. It must your previously selected interpreter.

I faced the same issue when running the program in Pycharm, there is a file in venv >> scripts >> pyvenv.cfg which had include-system-site-packages = false. But once it is changed and set to true it worked for me.
version_info = 3.10.0.final.0 include-system-site-packages = true
Make sure you're using correct python interpreter. Example: On Ubuntu operating system, for python2 there's pip, but for python3 there's pip3
using the wrong pip will make your packages unavailable for the other python version.
Check your python install version. If you have multiple versions be sure to use the correct pip version related.
pip show mysql-connector-python
# or
pip3 show mysql-connector-python
If this returns:
WARNING: Package(s) not found: mysql-connector-python
Then run
pip install mysql-connector-python
# or
pip3 install mysql-connector-python
Rerun the first command and you should now see something like this:
>>> pip show mysql-connector-python
Name: mysql-connector-python
Version: 8.3.0
Summary: MySQL driver written in Python
Home-page: http://dev.mysql.com/doc/connector-python/en/index.html
Author: Oracle and/or its affiliates
Author-email:
License: GNU GPLv2 (with FOSS License Exception)
Location: C:\Users\JayRizzo\AppData\Roaming\Python\Python311\site-packages
Requires:
Required-by: