How can I connect with python to a mysql database that is on an ubuntu server (located on a VMware Workstation on the same computer)? My operating system is Windows.

import pymysql from tkinter import messagebox

conn = pymysql.connect(host=".....", user="......", password="......", database="........", port=...)

cursor = conn.cursor() get_students = "select * from students"

try: cursor.execute(get_students) conn.commit() for i in cursor: print(i[1]) except: messagebox.showinfo("Failed to fetch files from database")

This code gives me an error: "Access denied for the user....."

0

There are 0 best solutions below