问题:在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.youkuaiyun.com/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')
在PowerShell环境下,使用easy_install安装MySQL-python失败,提示找不到合适的分布。解决方案是手动从codegood.com下载MySQL-python后,再通过easy_install安装。成功后,通过importMySQLdb进行测试。另外,遇到Access denied for user 'root'@'localhost'的权限错误,可参考youkuaiyun.com的相关文章解决。最后,执行SQL语句时出现1064错误,表明SQL语法有误,需要检查对应MySQL版本的语法手册。
1639

被折叠的 条评论
为什么被折叠?



