Vegemo-bear / flask-LiteAI

算法部署平台的后端服务器,主要用于与前端服务器进行数据的互传,格式包括但不限于文本/图片。项目的可扩展性非常强,操作也很简单,适用于任何算法的部署,如目标检测、实例分割,以及AIGC等。
12 stars 2 forks source link

Access denied for user 'root'@'localhost' #1

Open smartadpole opened 1 year ago

smartadpole commented 1 year ago

error


(flask) hao@hao110:/WORK/CODE/Python/platform/liteAI/flask-LiteAI/myweb-flask$ flask db migrate
Traceback (most recent call last):
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 145, in __init__
    self._dbapi_connection = engine.raw_connection()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 3275, in raw_connection
    return self.pool.connect()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 455, in connect
    return _ConnectionFairy._checkout(self)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 1271, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 719, in checkout
    rec = pool._do_get()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/pool/impl.py", line 169, in _do_get
    self._dec_overflow()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 147, in __exit__
    raise exc_value.with_traceback(exc_tb)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/pool/impl.py", line 166, in _do_get
    return self._create_connection()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 396, in _create_connection
    return _ConnectionRecord(self)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 681, in __init__
    self.__connect()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 906, in __connect
    pool.logger.debug("Error on connect(): %s", e)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 147, in __exit__
    raise exc_value.with_traceback(exc_tb)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 901, in __connect
    self.dbapi_connection = connection = pool._invoke_creator(self)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/engine/create.py", line 636, in connect
    return dialect.connect(*cargs, **cparams)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 580, in connect
    return self.loaded_dbapi.connect(*cargs, **cparams)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/pymysql/connections.py", line 352, in __init__
    self.connect()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/pymysql/connections.py", line 636, in connect
    self._request_authentication()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/pymysql/connections.py", line 911, in _request_authentication
    auth_packet = self._read_packet()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/pymysql/connections.py", line 729, in _read_packet
    packet.raise_for_error()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1698, "Access denied for user 'root'@'localhost'")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/WORK/LIB/Python/flask/bin/flask", line 8, in <module>
    sys.exit(main())
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/flask/cli.py", line 1050, in main
    cli.main()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/flask/cli.py", line 357, in decorator
    return __ctx.invoke(f, *args, **kwargs)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/flask_migrate/cli.py", line 105, in migrate
    _migrate(directory, message, sql, head, splice, branch_label, version_path,
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/flask_migrate/__init__.py", line 111, in wrapped
    f(*args, **kwargs)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/flask_migrate/__init__.py", line 170, in migrate
    command.revision(config, message, autogenerate=True, sql=sql,
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/alembic/command.py", line 229, in revision
    script_directory.run_env()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/alembic/script/base.py", line 576, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/alembic/util/pyfiles.py", line 94, in load_python_file
    module = load_module_py(module_id, path)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/alembic/util/pyfiles.py", line 110, in load_module_py
    spec.loader.exec_module(module)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/WORK/CODE/Python/platform/liteAI/flask-LiteAI/myweb-flask/migrations/env.py", line 110, in <module>
    run_migrations_online()
  File "/WORK/CODE/Python/platform/liteAI/flask-LiteAI/myweb-flask/migrations/env.py", line 95, in run_migrations_online
    with connectable.connect() as connection:
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 3251, in connect
    return self._connection_cls(self)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 147, in __init__
    Connection._handle_dbapi_exception_noconnection(
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2413, in _handle_dbapi_exception_noconnection
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 145, in __init__
    self._dbapi_connection = engine.raw_connection()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 3275, in raw_connection
    return self.pool.connect()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 455, in connect
    return _ConnectionFairy._checkout(self)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 1271, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 719, in checkout
    rec = pool._do_get()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/pool/impl.py", line 169, in _do_get
    self._dec_overflow()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 147, in __exit__
    raise exc_value.with_traceback(exc_tb)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/pool/impl.py", line 166, in _do_get
    return self._create_connection()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 396, in _create_connection
    return _ConnectionRecord(self)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 681, in __init__
    self.__connect()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 906, in __connect
    pool.logger.debug("Error on connect(): %s", e)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 147, in __exit__
    raise exc_value.with_traceback(exc_tb)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 901, in __connect
    self.dbapi_connection = connection = pool._invoke_creator(self)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/engine/create.py", line 636, in connect
    return dialect.connect(*cargs, **cparams)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 580, in connect
    return self.loaded_dbapi.connect(*cargs, **cparams)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/pymysql/connections.py", line 352, in __init__
    self.connect()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/pymysql/connections.py", line 636, in connect
    self._request_authentication()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/pymysql/connections.py", line 911, in _request_authentication
    auth_packet = self._read_packet()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/pymysql/connections.py", line 729, in _read_packet
    packet.raise_for_error()
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/WORK/LIB/Python/flask/lib/python3.8/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1698, "Access denied for user 'root'@'localhost'")
(Background on this error at: https://sqlalche.me/e/20/e3q8)
SeabirdShore commented 9 months ago

https://blog.csdn.net/baibai_bjt/article/details/106715276