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
pip list
command also lists PyMySQL (0.9.2)
.
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')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.