Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker部署不支持mysql自定义用户和密码吗 #1

Closed
everythingok001 opened this issue Aug 28, 2017 · 25 comments
Closed

docker部署不支持mysql自定义用户和密码吗 #1

everythingok001 opened this issue Aug 28, 2017 · 25 comments

Comments

@everythingok001
Copy link

docker部署不支持mysql自定义用户和密码吗

@brookshi
Copy link
Owner

brookshi commented Aug 28, 2017

应该是可以的,连数据库时会优先找这几个环境变量:

HITCHHIKER_DB_HOST
HITCHHIKER_DB_PORT
HITCHHIKER_DB_USERNAME
MYSQL_DATABASE
MYSQL_ROOT_PASSWORD

所以只需要改下 docker-compose.yml 文件,在hitchhiker的container里加上env:
HITCHHIKER_DB_USERNAM以及MYSQL_ROOT_PASSWORD就可以了

@everythingok001
Copy link
Author

ok

@brookshi
Copy link
Owner

对了,mysql的container也得改下

@everythingok001
Copy link
Author

我有自己的数据库,不用再启动一个了,我去试试不用compose

@brookshi
Copy link
Owner

用的是这个 MYSQL_ROOT_PASSWORD, 因为想到可能会和mysql装一起,mysql用的这个

@everythingok001
Copy link
Author

貌似不行,启动的时候,直接使用root去连的HITCHHIKER_DB_USERNAM这个好像不起作用

@brookshi
Copy link
Owner

HITCHHIKER_DB_USERNAM 少了一个E,而且这个是name哦,也就是root,数据库的话是MYSQL_DATABASE

@brookshi
Copy link
Owner

加些说明

HITCHHIKER_DB_HOST               DB的host
HITCHHIKER_DB_PORT                DB的端口
MYSQL_DATABASE                      DB数据库的名字
HITCHHIKER_DB_USERNAME      DB的user name, eg: root
MYSQL_ROOT_PASSWORD         DB的密码

@everythingok001
Copy link
Author

部署好了,注册时候,TypeError: Failed to fetch

@brookshi
Copy link
Owner

brookshi commented Aug 28, 2017

可否看下浏览器的控制台,把错误消息截个图我看下

@everythingok001
Copy link
Author

我知道了,APP_HOST没有设置

@brookshi
Copy link
Owner

对的,需要一个HITCHHIKER_APP_HOST

@everythingok001
Copy link
Author

部署好了,post请求formdata类型,该怎么填写

@brookshi
Copy link
Owner

对form这块还不太完善,需要在header里写content-type: multipart/form-data

@everythingok001
Copy link
Author

那参数呢,写在body里,a=b&c=d?

@everythingok001
Copy link
Author

字体看起来有点费劲,个人意见

@brookshi
Copy link
Owner

这个需要写在url里,也可以设置到变量里

@everythingok001
Copy link
Author

好的,知道了,希望越来越好!

@brookshi
Copy link
Owner

brookshi commented Aug 28, 2017

是吗,用的一个程序员专用的等宽开源字体,刚开始我看得也不太习惯,不过回头再找找看有没有更好些的开源字体

@brookshi
Copy link
Owner

谢谢:)

@everythingok001
Copy link
Author

写代码倒是可以用这个字体,但是用来网站显示可能有点不大好,其实不用刻意使用字体,默认就好吧

@brookshi
Copy link
Owner

也是,大家都习惯了默认的字体,回头去掉试试看

@everythingok001
Copy link
Author

可以close了, :)

@brookshi
Copy link
Owner

嗯:)

@jyl4944204
Copy link

嗯:)

[2019-05-06 09:47:50.369] [ERROR] console - Error: ER_PARSE_ERROR: 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 'json NOT NULL, createDate datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `' at line 1

对mysql版本有要求吗,创建账户后,mysql报错

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants