安裝和使用MySQL的過程遇到問題和解決的方法
問題:在powershell下用easy_install來安裝MY-SQL-python無法安裝成功,錯誤資訊為:
No local packages or download links found for MySQL-python
error: Could not find suitable distribution for Requirement.parse('MySQL-python')。
解決方法:在http://www.codegood.com/downloads下載MYSQL-python,下載完畢後再用easy_install安裝即可。用
importMySQLdb
在http://dev.mysql.com/downloads/file/?id=458918下載mysql-connector
問題:import mysql.connector:mysql.connector.errors.ProgrammingError: 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
解決方法:連結:http://blog.csdn.net/hsg77/article/details/39159191
問題: cursor.execute('select * from user where id = %s', '1'),出現問題mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%s' at line 1。