python3 web.py
2017-10-26 14:57
316 查看
https://stackoverflow.com/questions/41304192/python-alternative-for-web-py-on-python3
Python3 安装 web.py 失败:
按一下办法解决:
Python3 安装MySQL
http://www.runoob.com/python3/python3-mysql.html
改错误:
ERROR 1698 (28000): Access denied for user ‘root’@’localhost’
首先查看mysql的conf文件查看用户名和密码:
展示如下:
执行
展示如下:
其中user和password即为你的mysql的用户名和密码。再次链接数据库 即可成功!
这个错误为,str插入数据库,str有中文参与,需要数据库进行支持,解决办法:
default charset utf8 collate utf8_unicode_ci 至关重要!
其次,每一次连接数据库也需要设置charset:
综上即可解决该问题!
Python3 安装 web.py 失败:
import utils, db, net, wsgi, http, webapi, httpserver, debugerror ImportError: No module named 'utils'
按一下办法解决:
pip3 install web.py==0.40.dev0
Python3 安装MySQL
http://www.runoob.com/python3/python3-mysql.html
pip3 install PyMySQL
改错误:
ERROR 1698 (28000): Access denied for user ‘root’@’localhost’
首先查看mysql的conf文件查看用户名和密码:
/etc/mysql
展示如下:
conf.d debian.cnf debian-start my.cnf my.cnf.fallback mysql.cnf mysql.conf.d
执行
sudo cat debian.cnf
展示如下:
# Automatically generated for Debian scripts. DO NOT TOUCH! [client] host = localhost user = debian-sys-maint password = XG6IscrXa4gslb4n socket = /var/run/mysqld/mysqld.sock [mysql_upgrade] host = localhost user = debian-sys-maint password = XG6IscrXa4gslb4n socket = /var/run/mysqld/mysqld.soc
其中user和password即为你的mysql的用户名和密码。再次链接数据库 即可成功!
ERROR (1366, "Incorrect string value: '\\xE6\\x8F\\x8F\\xE8\\xBF\\xB0' for column 'projectDescribe' at row 2") ERROR (1064, "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 '1.1.0.0\\xe6\\x8f\\x8f\\xe8\\xbf\\xb0'', isUse = 0 WHERE md5 = '339a150f79a8c8d125ad8c' at line 1 ERROR 'latin-1' codec can't encode characters in position 62-63: ordinal not in range(256)
这个错误为,str插入数据库,str有中文参与,需要数据库进行支持,解决办法:
cur.execute("CREATE DATABASE %s default charset utf8 collate utf8_unicode_ci" % operationDB.dbName)
default charset utf8 collate utf8_unicode_ci 至关重要!
其次,每一次连接数据库也需要设置charset:
pymysql.connect("localhost", dbUser, dbPassword, dbName, charset="utf8")
综上即可解决该问题!
相关文章推荐
- Python(21):用web.py搭一个服务端(python3)
- python web py入门-2-显示一个demo网页
- Python下发布web service(三):web.py简介及使用
- python web py入门-1-web.py简介和安装
- python的一个简易web程序index.py
- nginx+webpy配置灵活限速(python)
- 在windows下搭建python环境,安装python、pip、virtualen、web.py
- python使用web.py建立第一个hello world程序
- Python初学,web.py的Hello World
- python的web.py框架
- python:使用web.py实现最简易的web服务器
- python3使用web.py遇到的找不属性的错误解决
- 在python 2.7下面使用webpy框架
- Python微框架web.py初印象
- centos7简单搭建nginx+uwsgi+web.py的Python web环境(记录)
- Linux下搭建基于Nginx+FastCGI+Flup+Webpy+Cheetah的Python Web环境
- python webpy 框架环境架设
- python之web.py
- linux下搭建nginx+uwsgi+web.py的python web服务器
- python web.py 网页开发