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

must have one register DataBase alias named default #12

Open
s016374 opened this issue Jun 14, 2016 · 7 comments
Open

must have one register DataBase alias named default #12

s016374 opened this issue Jun 14, 2016 · 7 comments

Comments

@s016374
Copy link

s016374 commented Jun 14, 2016

错误:
[root@408cb45436b1 opt]# /home/go/bin/webcron
[ORM]register db Ping default, dial tcp :3306: getsockopt: connection refused
must have one register DataBase alias named default

mysql -hX.X.X.X -uXXX -p 可以通

请问怎么解决?

环境:
Linux version 3.10.0-327.el7.x86_64 ([email protected]) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Thu Nov 19 22:10:57 UTC 2015
go version go1.6.2 linux/amd64

@xiaodingchen
Copy link

我的也是这样,求怎么解决的

@s016374
Copy link
Author

s016374 commented Mar 3, 2017

时间长了,记不清当时是怎么解决的了,但应该还是配置写的不对导致的。
看了下现在的配置如下,正常工作,希望有帮助。
appname = webcron
httpport = 8000
runmode = dev
jobs.pool = 50
site.name = schedule_manager
db.host = 192.168.x.x
db.user = xxx
db.password = xxx
db.port = 3306
db.name = dataserver
db.prefix = t_
db.timezone = Asia/Shanghai
mail.queue_size = 100
mail.from = [email protected]
mail.host = smtp.example.com
mail.port = 25
mail.user = username
mail.password = your password

@Gongruixiao
Copy link

mysql配置确认没有问题,但是启动也报这个错误

./webcron 
[ORM]2017/11/15 06:38:14 register db Ping `default`, dial tcp :3306: getsockopt: connection refused
must have one register DataBase alias named `default`

@fortyhub
Copy link

有大佬解决这个问题吗?
./webcron
[ORM]2017/11/16 16:43:10 register db Ping default, Error 1045: Access denied for user ''@'127.0.0.1' (using password: NO)
must have one register DataBase alias named default

@Gongruixiao
Copy link

我的问题已经解决了,安装说明中少写了一步,需要go build编译产生启动文件,原来的启动文件是无法使用的,导致启动报这个错误

1.go get github.com/lisijie/webcron
2.cd /root/go/src/github.com/lisijie/webcron
   go build

@xjiaon
Copy link

xjiaon commented Apr 24, 2019

github.com/lisijie/webcron/app/mail

app/mail/mail.go:38:6: undefined: beego.Error

请问go build 报这个错误是什么原因?

@Git-wyf
Copy link

Git-wyf commented Oct 12, 2019

是由于mysql server 默认连接的是127.0.0.1,
如果是Ubuntu环境可以建议你修改 sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf这个文件,
具体可以参考以下:
https://www.cnblogs.com/LazyAngel/p/11656762.html

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

6 participants