如何将mysql用作jupyterhub';s数据库?
JupyterHub的默认数据库是SQLite数据库。但是我想用MySQL替换SQLite数据库。我尝试在配置文件中使用config变量如何将mysql用作jupyterhub';s数据库?,mysql,docker,jupyterhub,Mysql,Docker,Jupyterhub,JupyterHub的默认数据库是SQLite数据库。但是我想用MySQL替换SQLite数据库。我尝试在配置文件中使用config变量 c.JupyterHub.db_url = 'jdbc:mysql://localhost:3306/test' 但当我运行jupyterhub时,它会产生如下错误: sqlalchemy.exc.ArgumentError: Could not parse rfc1738 URL from string 'jdbc:mysql://localhost:33
c.JupyterHub.db_url = 'jdbc:mysql://localhost:3306/test'
但当我运行jupyterhub时,它会产生如下错误:
sqlalchemy.exc.ArgumentError: Could not parse rfc1738 URL from string 'jdbc:mysql://localhost:3306/test'
我搜索并研究了jupyterhub的官方文档,但没有找到任何与我的问题相关的东西。这个问题有什么解决办法吗??有人吗
谢谢大家! 表示url语法必须定义如下:
//<user>:<password>@<host>:<port>/<url-path>
/:@:/
RFC1738的语法与。看起来您正试图用JDBC语法解析RFC1738 url(JupyterHub所需)。找到了解决上述问题的确切路线
c.JupyterHub.db_url = 'mysql+mysqlconnector://{}:{}@{}/{}{}'.format("username","password","host","database","")
在JH配置中添加池回收选项。根据文件
c.JupyterHub.db_kwargs = {"pool_recycle":300}
这是对上面正确答案的补充,如果您在使用mysql时不添加该参数,您将出现超时问题,正如文档()所述,这看起来并不能解决这里的问题陈述。