import pymysql db = pymysql.connect(host = 'localhost',user = 'root',password =
'asdfgh',port = 3306) cursor = db.cursor() cursor.execute('SELECT VERSION()')
data = cursor.fetchone() print('database version:',data) cursor.execute('CREATE
DATABASE spiders DEFAULT CHARACTER SET utf8') db.close()


Resolvent:

1. opencmd Command line window, inputcd C:\Program Files (x86)\MySQL\MySQL Server
5.7\bin, Enter the directory.( This is yoursmysql Underbin Folder)

2. inputmysql -hlocalhost -uroot -p, Enter the password, Then connectmysql

3. inputALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY
' Your password'; Enter and the modification is successful.



Finally, run the code again and it will appear.

database version: ('8.0.11',)