安装和使用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。

解决方法:改为ursor.execute('select * from user where id = 1')
发布了30 篇原创文章 · 获赞 7 · 访问量 4万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章