0

I wrote this piece of code to connect the MySQLServer from Jupyter notebook:

import sqlalchemy
from sqlalchemy import create_engine

engine = sqlalchemy.create_engine(‘mysql+mysqlconnector://root:password@localhost:3306/dbname′)

I am getting the following error:

File "<ipython-input-12-c958f7670e02>", line 6
    engine = sqlalchemy.create_engine(‘mysql+mysqlconnector://root:password@localhost:3306/events′)
                                           ^
SyntaxError: invalid character in identifier

enter image description here

pip list command also lists PyMySQL (0.9.2).

Debbie
  • 911
  • 3
  • 20
  • 45

1 Answers1

-1

Replace ‘ character to ' .

Here is new code:

import sqlalchemy from sqlalchemy import create_engine

engine = sqlalchemy.create_engine('mysql+mysqlconnector://root:password@localhost:3306/dbname')