Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将mysql用作jupyterhub';s数据库?_Mysql_Docker_Jupyterhub - Fatal编程技术网

如何将mysql用作jupyterhub';s数据库?

如何将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

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: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时不添加该参数,您将出现超时问题,正如文档()所述,这看起来并不能解决这里的问题陈述。