『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 4289|回复: 8

[基础教程] 0.116.2更换mysql数据库,有成功的吗?

[复制链接]

12

主题

179

帖子

1307

积分

金牌会员

Rank: 6Rank: 6

积分
1307
金钱
1123
HASS币
20
发表于 2020-10-15 14:31:32 | 显示全部楼层 |阅读模式
本帖最后由 mildrabbit 于 2020-10-15 16:47 编辑

0.116.2更换mysql数据库,有成功的吗?参照官方的文档 也做了相关的设置,和相关软件的安装。。系统是装在docker里的hassio,mysql是装在宿主机里的,也试过数据库地址写宿主机的IP地址都 不行。。。用mysql主要是为了数据的持久化。宿主机用的ubunut 20.04

-----ubuntu 20.04的MariaDB的配置有点奇怪。参照此贴修改ok-------留给新朋友们填坑。
https://blog.csdn.net/qq455013140/article/details/79151524

1602751535824.jpg


配置文件 这样写,没有生效,
WechatIMG2.jpeg



这样写,老是报错。。。

WechatIMG3.jpeg



报错内容

WechatIMG4.jpeg

贴下日志。

这是写宿主机IP地址时的报错。

2020-10-15 15:37:28 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to MySQL server on '10.0.0.58' (115)"),
(Background on this error at: http://sqlalche.me/e/13/e3q8) (retrying in 3 seconds),
2020-10-15 15:37:31 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to MySQL server on '10.0.0.58' (115)"),
(Background on this error at: http://sqlalche.me/e/13/e3q8) (retrying in 3 seconds),
2020-10-15 15:37:34 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to MySQL server on '10.0.0.58' (115)"),
(Background on this error at: http://sqlalche.me/e/13/e3q8) (retrying in 3 seconds),
2020-10-15 15:37:37 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to MySQL server on '10.0.0.58' (115)"),
(Background on this error at: http://sqlalche.me/e/13/e3q8) (retrying in 3 seconds),
2020-10-15 15:37:40 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to MySQL server on '10.0.0.58' (115)"),
(Background on this error at: http://sqlalche.me/e/13/e3q8) (retrying in 3 seconds),
2020-10-15 15:37:40 ERROR (MainThread) [homeassistant.setup] Setup failed for recorder: Integration failed to initialize.,
2020-10-15 15:37:40 WARNING (MainThread) [homeassistant.components.lovelace] Lovelace is running in storage mode. Define resources via user interface,
2020-10-15 15:37:41 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of logbook. Setup failed for dependencies: recorder,
2020-10-15 15:37:41 ERROR (MainThread) [homeassistant.setup] Setup failed for logbook: Could not set up all dependencies.,
2020-10-15 15:37:41 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of history. Setup failed for dependencies: recorder,
2020-10-15 15:37:41 ERROR (MainThread) [homeassistant.setup] Setup failed for history: Could not set up all dependencies.,
2020-10-15 15:37:41 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: history, logbook,
2020-10-15 15:37:41 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: Could not set up all dependencies.,
2020-10-15 15:37:54 ERROR (MainThread) [custom_components.hacs.factory] maykar/custom-header - Repository is archived.,
[cont-finish.d] executing container finish scripts...,
[cont-finish.d] done.,
[s6-finish] waiting for services.,
Client error on /homeassistant/restart request ,
Error doing job: Task exception was never retrieved,
Traceback (most recent call last):,
  File "/usr/src/homeassistant/homeassistant/components/ssdp/__init__.py", line 68, in async_scan,
    entries = await self.hass.async_add_executor_job(ssdp.scan),
  File "/usr/src/homeassistant/homeassistant/core.py", line 350, in async_add_executor_job,
    task = self.loop.run_in_executor(None, target, *args),
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 783, in run_in_executor,
    executor.submit(func, *args), loop=self),
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 179, in submit,
    raise RuntimeError('cannot schedule new futures after shutdown'),
RuntimeError: cannot schedule new futures after shutdown,
s6-svscanctl: fatal: unable to control /var/run/s6/services: supervisor not listening,
[s6-finish] sending all processes the TERM signal.,
[s6-finish] sending all processes the KILL signal and exiting.,
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.,
[s6-init] ensuring user provided files have correct perms...exited 0.,
[fix-attrs.d] applying ownership & permissions fixes...,
[fix-attrs.d] done.,
[cont-init.d] executing container initialization scripts...,
[cont-init.d] udev.sh: executing... ,
[15:39:01] INFO: Update udev information,
[cont-init.d] udev.sh: exited 0.,
[cont-init.d] done.,
[services.d] starting services,
[services.d] done.,
2020-10-15 15:39:06 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for ha_baidu_map which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.,
2020-10-15 15:39:06 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.,
这是写127.0.0.1地址时的报错。

2020-10-15 15:39:06 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1698, "Access denied for user 'root'@'localhost'"),
(Background on this error at: http://sqlalche.me/e/13/e3q8) (retrying in 3 seconds),
2020-10-15 15:39:09 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1698, "Access denied for user 'root'@'localhost'"),
(Background on this error at: http://sqlalche.me/e/13/e3q8) (retrying in 3 seconds),
2020-10-15 15:39:12 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1698, "Access denied for user 'root'@'localhost'"),
(Background on this error at: http://sqlalche.me/e/13/e3q8) (retrying in 3 seconds),
2020-10-15 15:39:15 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1698, "Access denied for user 'root'@'localhost'"),
(Background on this error at: http://sqlalche.me/e/13/e3q8) (retrying in 3 seconds),
2020-10-15 15:39:16 WARNING (MainThread) [homeassistant.setup] Setup of recorder is taking over 10 seconds.,
2020-10-15 15:39:18 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1698, "Access denied for user 'root'@'localhost'"),
(Background on this error at: http://sqlalche.me/e/13/e3q8) (retrying in 3 seconds),
2020-10-15 15:39:21 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1698, "Access denied for user 'root'@'localhost'"),
(Background on this error at: http://sqlalche.me/e/13/e3q8) (retrying in 3 seconds),
2020-10-15 15:39:24 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1698, "Access denied for user 'root'@'localhost'"),
(Background on this error at: http://sqlalche.me/e/13/e3q8) (retrying in 3 seconds),
2020-10-15 15:39:27 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1698, "Access denied for user 'root'@'localhost'"),
(Background on this error at: http://sqlalche.me/e/13/e3q8) (retrying in 3 seconds),
2020-10-15 15:39:30 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1698, "Access denied for user 'root'@'localhost'"),
(Background on this error at: http://sqlalche.me/e/13/e3q8) (retrying in 3 seconds),
2020-10-15 15:39:33 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1698, "Access denied for user 'root'@'localhost'"),
(Background on this error at: http://sqlalche.me/e/13/e3q8) (retrying in 3 seconds),
2020-10-15 15:39:33 ERROR (MainThread) [homeassistant.setup] Setup failed for recorder: Integration failed to initialize.,
2020-10-15 15:39:33 WARNING (MainThread) [homeassistant.components.lovelace] Lovelace is running in storage mode. Define resources via user interface,
2020-10-15 15:39:34 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of logbook. Setup failed for dependencies: recorder,
2020-10-15 15:39:34 ERROR (MainThread) [homeassistant.setup] Setup failed for logbook: Could not set up all dependencies.,
2020-10-15 15:39:34 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of history. Setup failed for dependencies: recorder,
2020-10-15 15:39:34 ERROR (MainThread) [homeassistant.setup] Setup failed for history: Could not set up all dependencies.,
2020-10-15 15:39:34 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: history, logbook,
2020-10-15 15:39:34 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: Could not set up all dependencies.,
2020-10-15 15:39:46 ERROR (MainThread) [custom_components.hacs.custom_components.hacs.remaining_github_calls] Cannot connect to host api.github.com:443 ssl:default [Connect call failed ('13.250.168.23', 443)],
2020-10-15 15:39:46 CRITICAL (MainThread) [custom_components.hacs] Your GitHub token is not valid,
2020-10-15 15:39:46 WARNING (MainThread) [homeassistant.config_entries] Config entry for hacs not ready yet. Retrying in 5 seconds,
2020-10-15 15:39:51 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry  for hacs,
Traceback (most recent call last):,
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 231, in async_setup,
    result = await component.async_setup_entry(hass, self)  # type: ignore,
  File "/config/custom_components/hacs/__init__.py", line 30, in async_setup_entry,
    return await hacs_ui_setup(hass, config_entry),
  File "/config/custom_components/hacs/operational/setup.py", line 62, in async_setup_entry,
    return await async_startup_wrapper_for_config_entry(),
  File "/config/custom_components/hacs/operational/setup.py", line 87, in async_startup_wrapper_for_config_entry,
    startup_result = await async_hacs_startup(),
  File "/config/custom_components/hacs/operational/setup.py", line 132, in async_hacs_startup,
    await async_setup_frontend(),
  File "/config/custom_components/hacs/operational/setup_actions/frontend.py", line 38, in async_setup_frontend,
    hacs.hass.components.frontend.async_register_built_in_panel(,
  File "/usr/src/homeassistant/homeassistant/components/frontend/__init__.py", line 196, in async_register_built_in_panel,
    raise ValueError(f"Overwriting panel {panel.frontend_url_path}"),
ValueError: Overwriting panel hacs,
2020-10-15 15:40:04 ERROR (MainThread) [homeassistant.components.updater] Timeout fetching Home Assistant update data,


回复

使用道具 举报

105

主题

2954

帖子

1万

积分

超级版主

智能家居&单板滑雪痴迷爱好者

Rank: 8Rank: 8

积分
12103
金钱
9084
HASS币
460

教程狂人突出贡献

发表于 2020-10-15 15:28:20 | 显示全部楼层
1、看文档
2、看日志
3、先用ha检查一下配置文件是否存在语法错误
4、recorder和default_config是平级的
回复

使用道具 举报

73

主题

1165

帖子

6645

积分

论坛元老

Rank: 8Rank: 8

积分
6645
金钱
5475
HASS币
30
发表于 2020-10-15 15:57:14 | 显示全部楼层
postgre数据库,很快
回复

使用道具 举报

12

主题

179

帖子

1307

积分

金牌会员

Rank: 6Rank: 6

积分
1307
金钱
1123
HASS币
20
 楼主| 发表于 2020-10-15 16:01:37 | 显示全部楼层
xuyang 发表于 2020-10-15 15:57
postgre数据库,很快

mysql都还没有搞明白。。。。
回复

使用道具 举报

0

主题

143

帖子

4351

积分

论坛元老

Rank: 8Rank: 8

积分
4351
金钱
4208
HASS币
0
发表于 2020-10-15 16:21:49 | 显示全部楼层
把addon卸载了重新安装
回复

使用道具 举报

12

主题

179

帖子

1307

积分

金牌会员

Rank: 6Rank: 6

积分
1307
金钱
1123
HASS币
20
 楼主| 发表于 2020-10-15 16:26:57 | 显示全部楼层
csc 发表于 2020-10-15 16:21
把addon卸载了重新安装

卸载哪个addon?请教
回复

使用道具 举报

12

主题

179

帖子

1307

积分

金牌会员

Rank: 6Rank: 6

积分
1307
金钱
1123
HASS币
20
 楼主| 发表于 2020-10-15 16:41:34 | 显示全部楼层
XCray 发表于 2020-10-15 15:28
1、看文档
2、看日志
3、先用ha检查一下配置文件是否存在语法错误

感谢提醒看日志,我查看日志发现是数据库连接有问题。修改后OK。
回复

使用道具 举报

0

主题

18

帖子

87

积分

注册会员

Rank: 2

积分
87
金钱
69
HASS币
0
发表于 2020-11-1 15:14:33 | 显示全部楼层
mildrabbit 发表于 2020-10-15 16:41
感谢提醒看日志,我查看日志发现是数据库连接有问题。修改后OK。

怎么解决的?
回复

使用道具 举报

12

主题

179

帖子

1307

积分

金牌会员

Rank: 6Rank: 6

积分
1307
金钱
1123
HASS币
20
 楼主| 发表于 2020-11-2 09:02:38 | 显示全部楼层

2020-10-15 15:39:33 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1698, "Access denied for user 'root'@'localhost'"),


看这句,我的是因为没有给root用户本机访问权,修改数据库root用户权限后恢复正常
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-26 14:55 , Processed in 0.304418 second(s), 35 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表