-2

When I work with mysql.connector it doesn't show me suggestions.

What should I do?

enter image description here

JialeDu
  • 6,021
  • 2
  • 5
  • 24

1 Answers1

0

Please use the PyMySQL package.

First install the PyMySQL package using the pip command

pip install PyMySQL

Then modify the code as follows

import pymysql

mydb = pymysql.connect(
    host = 'localhost',
    user = 'root',
    password = ''
)

mycursor = mydb.cursor()

sql = 'create database py_university_db'

mycursor.e

Now everything works

enter image description here

JialeDu
  • 6,021
  • 2
  • 5
  • 24