安装和使用MySQL的过程遇到问题和解决的方法

来源:互联网 发布:颜如玉胶原蛋白知乎 编辑:程序博客网 时间:2024/05/21 17:03

问题:在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')
0 0
原创粉丝点击