dongweiming / wechat-admin

Wechat Management System
https://dongweiming.github.io/wechat-admin/
GNU General Public License v3.0
1.75k stars 420 forks source link

initdb 错误 #62

Open 282144757 opened 6 years ago

282144757 commented 6 years ago

Traceback (most recent call last): File "venv/bin/flask", line 11, in sys.exit(main()) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/flask/cli.py", line 513, in main cli.main(args=args, prog_name=name) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/flask/cli.py", line 380, in main return AppGroup.main(self, args, kwargs) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, ctx.params) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/click/core.py", line 535, in invoke return callback(args, kwargs) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, *kwargs) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/flask/cli.py", line 257, in decorator return __ctx.invoke(f, args, kwargs) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/click/core.py", line 535, in invoke return callback(args, kwargs) File "/Users/levy/wechat-admin/manager.py", line 15, in initdb db.drop_all() File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/flask_sqlalchemy/init.py", line 1015, in drop_all self._execute_for_all_tables(app, bind, 'drop_all') File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/flask_sqlalchemy/init.py", line 999, in _execute_for_all_tables op(bind=self.get_engine(app, bind), extra) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/sqlalchemy/sql/schema.py", line 4031, in drop_all tables=tables) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1939, in _run_visitor with self._optional_conn_ctx_manager(connection) as conn: File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 87, in enter return next(self.gen) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1932, in _optional_conn_ctx_manager with self.contextual_connect() as conn: File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2123, in contextual_connect self._wrap_pool_connect(self.pool.connect, None), File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2158, in _wrap_pool_connect return fn() File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/sqlalchemy/pool.py", line 403, in connect return _ConnectionFairy._checkout(self) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/sqlalchemy/pool.py", line 791, in _checkout fairy = _ConnectionRecord.checkout(pool) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/sqlalchemy/pool.py", line 532, in checkout rec = pool._do_get() File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/sqlalchemy/pool.py", line 1196, in _do_get self._dec_overflow() File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 66, in exit compat.reraise(exc_type, exc_value, exc_tb) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 187, in reraise raise value File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/sqlalchemy/pool.py", line 1193, in _do_get return self._create_connection() File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/sqlalchemy/pool.py", line 350, in _create_connection return _ConnectionRecord(self) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/sqlalchemy/pool.py", line 477, in init self.connect(first_connect_check=True) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/sqlalchemy/pool.py", line 674, in connect connection = pool._invoke_creator(self) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 106, in connect return dialect.connect(cargs, cparams) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 411, in connect return self.dbapi.connect(*cargs, *cparams) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/pymysql/init.py", line 90, in Connect return Connection(args, kwargs) File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/pymysql/connections.py", line 706, in init self.connect() File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/pymysql/connections.py", line 931, in connect self._get_server_information() File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/pymysql/connections.py", line 1269, in _get_server_information self.server_charset = charset_by_id(lang).name File "/Users/levy/wechat-admin/venv/lib/python3.7/site-packages/pymysql/charset.py", line 38, in by_id return self._by_id[id] KeyError: 255

1980744819 commented 5 years ago

你找到解决办法了没

kaishuibaicai commented 5 years ago

/wechat-admin/venv/lib/python3.6/site-packages/pymysql/connections.py 里的链接mysql数据库默认登录密码是空的,需要找的connection的方法里填入你电脑里的mysql的登录密码,就可以初始化数据库了。