Install PyMySQL on a Windows 7 machine

I am not a python user, and although I used MySQL, I am not an expert. In addition, I am mainly a Windows user, and I know little about running command line scripts. So this may be a stupid question, but I still want to ask ...

(By the way, my goal is to install "Baseball on a stick")

I installed Python (version 3.3 on a Windows 7 machine).

The following is said to install pymysql. So I downloaded the .zip file from https://github.com/petehunt/PyMySQL/

Readme says: "Just run the build -py3k.sh script from the local directory. It will build the working package in the / py 3k directory." I absolutely do not understand what this means. How do I run this? I tried typing it into the Python command line interface, and it just gave me an error.

+5
source share
3 answers
+4
source

win + r, and then enter cmd then in the dos command enter the command: pip install pyMySQL but if your computer did not install pip, refer to this page https://pip.pypa.io/en/stable/

0
source

Python connect xampp mysql windows pymysql:

1:

  D:\python-3.6.2\Scripts > pip install pymysql

-2:

#!D:/python-3.6.2/python.exe 
print ("Content-Type: text/html\n")
import pymysql
conn = pymysql.connect(host='localhost', port=3306, user='root', passwd='', db='python_mysql')
cur = conn.cursor()
cur.execute("SELECT * FROM authors")
print(cur.description)
print(" Test")
for row in cur:
    print(row)
cur.close()
conn.close()

testconn.py htdocs/PythonProject http://localhost/PythonProject\test.py

0

All Articles