【急】正常使用了一年后突然无法连接本地mysql数据库


#1

设备是贝壳云,架构为arm64,使用docker搭建,使用镜像为https://github.com/domenukk/seafile-docker-pi。seafile版本应该是6.3.4.本来已经正常使用一年多,从未出现过问题,因此在里面存了许多重要资料比如论文等。但是现在不知为何突然用mac端的seadrive打开ppt文件时提示服务器内部问题,所以去查看了日志,发现出现无法连接本地服务器的问题。然后尝试重建docker容器,刚搭建完能访问网页,但是涉及数据库的操作比如查看文件,或者进入系统管理就会出错,查看日志发现如下错误:[05/13/2020 04:01:46][upgrade]: The container was recreated, running minor-upgrade.sh to fix the media symlinks,
[05/13/2020 04:01:46][upgrade]: Running script /opt/seafile/seafile-server-6.3.4/upgrade/minor-upgrade.sh,
,
-------------------------------------------------------------,
This script would do the minor upgrade for you.,
Press [ENTER] to contiune,
-------------------------------------------------------------,
,
,
------------------------------,
migrating avatars …,
,
,
DONE,
------------------------------,
,
,
updating seafile-server-latest symbolic link to /opt/seafile/seafile-server-6.3.4 …,
,
DONE,
------------------------------,
,
,
failed to run “ccnet-server -t”,
[05/13/20 04:01:46] …/common/session.c(132): using config file /opt/seafile/conf/ccnet.conf,
[05/13/20 04:01:46] …/common/ccnet-db.c(124): Failed to get database connection: Failed to connect to MySQL: Can’t connect to MySQL server on ‘127.0.0.1’ (111).,
[05/13/20 04:01:46] user-mgr.c(769): Failed to create user db tables.,
Traceback (most recent call last):,
File “/scripts/start.py”, line 86, in ,
main(),
File “/scripts/start.py”, line 71, in main,
call(’{} start’.format(get_script(‘seafile.sh’))),
File “/scripts/utils/init.py”, line 68, in call,
return subprocess.check_call(*a, **kw),
File “/usr/lib/python2.7/subprocess.py”, line 190, in check_call,
raise CalledProcessError(retcode, cmd),
subprocess.CalledProcessError: Command ‘/opt/seafile/seafile-server-6.3.4/seafile.sh start’ returned non-zero exit status 1,
*** /scripts/start.py exited with status 1.,
amysqladmin: connect to server at ‘localhost’ failed,
error: ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111 “Connection refused”)’,
Check that mysqld is running and that the socket: ‘/var/run/mysqld/mysqld.sock’ exists!,
*** Shutting down runit daemon (PID 37)…,
*** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown…,
May 13 04:01:47 f1d8b09e8450 syslog-ng[27]: syslog-ng shutting down; version=‘3.13.2’,
*** Killing all processes…,
*** Running /etc/my_init.d/01_create_data_links.sh…,
*** Running /etc/my_init.d/10_syslog-ng.init…,
May 13 04:02:49 f1d8b09e8450 syslog-ng[26]: syslog-ng starting up; version=‘3.13.2’,
*** Running /etc/my_init.d/99_mysql_setup.sh…,
*** Booting runit daemon…,
*** Runit started as PID 36,
*** Running /scripts/start.py…,
May 13 04:02:51 f1d8b09e8450 cron[43]: (CRON) INFO (pidfile fd = 3),
May 13 04:02:51 f1d8b09e8450 cron[43]: (CRON) INFO (Skipping @reboot jobs – not system startup),
[2020-05-13 04:02:51] Skip running setup-seafile-mysql.py because there is existing seafile-data folder.,
[05/13/2020 04:02:51][upgrade]: The container was recreated, running minor-upgrade.sh to fix the media symlinks,
[05/13/2020 04:02:51][upgrade]: Running script /opt/seafile/seafile-server-6.3.4/upgrade/minor-upgrade.sh,
,
-------------------------------------------------------------,
This script would do the minor upgrade for you.,
Press [ENTER] to contiune,
-------------------------------------------------------------,
,
,
------------------------------,
migrating avatars …,
,
,
DONE,
------------------------------,
,
,
updating seafile-server-latest symbolic link to /opt/seafile/seafile-server-6.3.4 …,
,
DONE,
------------------------------,
,
,
failed to run “ccnet-server -t”,
[05/13/20 04:02:51] …/common/session.c(132): using config file /opt/seafile/conf/ccnet.conf,
[05/13/20 04:02:51] …/common/ccnet-db.c(124): Failed to get database connection: Failed to connect to MySQL: Can’t connect to MySQL server on ‘127.0.0.1’ (111).,
[05/13/20 04:02:51] user-mgr.c(769): Failed to create user db tables.,
Traceback (most recent call last):,
File “/scripts/start.py”, line 86, in ,
main(),
File “/scripts/start.py”, line 71, in main,
call(’{} start’.format(get_script(‘seafile.sh’))),
File “/scripts/utils/init.py”, line 68, in call,
return subprocess.check_call(*a, **kw),
File “/usr/lib/python2.7/subprocess.py”, line 190, in check_call,
raise CalledProcessError(retcode, cmd),
subprocess.CalledProcessError: Command ‘/opt/seafile/seafile-server-6.3.4/seafile.sh start’ returned non-zero exit status 1,
*** /scripts/start.py exited with status 1.,
amysqladmin: connect to server at ‘localhost’ failed,
error: ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111 “Connection refused”)’,
Check that mysqld is running and that the socket: ‘/var/run/mysqld/mysqld.sock’ exists!,
*** Shutting down runit daemon (PID 36)…,
*** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown…,
May 13 04:02:52 f1d8b09e8450 syslog-ng[26]: syslog-ng shutting down; version=‘3.13.2’,
*** Killing all processes…,
按照论坛里的建议查看ccnet.conf并不知从何下手,以为面临毕业,里面的论文相关材料需要交给老师。恳请大家帮我,十分感谢。或者只要能恢复里面的数据就好。求好心的大佬帮我看看,不胜感激。


#2

有人帮我看下么 急 真不知可以如何恢复数据 无法下手


#3

看情况是没有链接到数据库没法获取用户信息,确认你的mysql正常,确认seafile ccnet里面关于mysql的信息以及登陆账号密码正确(数据库的管理密码)


#4

请问我该如何排查这个问题呢?需要查看什么文件么。还是需要输入什么命令查看结果呢?我所使用的seafile docker是官方x86版本的fork,作者做了一些修改以适配arm。再部署的过程中并不需要我设定mysql密码啊。我所使用的docker是seafile以及mysql都打包在同一个镜像,是原来官方6.xx版本的方式,不是7.xx版本这种docker-compose方式部署的。请问能提供一些详细点的提示么,让我好下手排查。因为我计算机专业的知识有限,我可能无法解决mysql方面的问题。


#5

先进入docker 中试一下MySQL是否能连接