Skip to content

error: sock = socket.create_connection #1

@kuzco1

Description

@kuzco1

I am trying to migrate my SQlite3 to influx with no access, so i copied the SQlite3 data to a new MariaDB. The MariaDB is static, means I am still using the SQLite for HA.
No, I have tried to import my MariaDB (MariaDB 10.11.6) of HA to influx, however I got the following error:


`Traceback (most recent call last):
File "/root/MariaDBInfluxDB_Migration/.venv/lib/python3.12/site-packages/pymysql/connections.py", line 649, in connect
sock = socket.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/socket.py", line 865, in create_connection
raise exceptions[0]
File "/usr/lib/python3.12/socket.py", line 850, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/root/MariaDBInfluxDB_Migration/my_influxdbmigration.py", line 15, in
mariadb_connection = pymysql.connect(
^^^^^^^^^^^^^^^^
File "/root/MariaDBInfluxDB_Migration/.venv/lib/python3.12/site-packages/pymysql/connections.py", line 361, in init
self.connect()
File "/root/MariaDBInfluxDB_Migration/.venv/lib/python3.12/site-packages/pymysql/connections.py", line 716, in connect
raise exc
pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '192.168.178.88' ([Errno 111] Connection refused)")
`


Have installed "pip install pymysql influxdb" and also editet the file "my_influxdbmigration.py"

MariaDB-Verbindung

mariadb_connection = pymysql.connect(
host="192.168.178.88",
port=3306,
user="homeassistant",
password="homeassistant",
database="homeassistant"
)
cursor = mariadb_connection.cursor()

InfluxDB-Verbindung

influx_client = InfluxDBClient(
host="192.168.178.88",
port=8086,
username="influxdba",
password="homeassistant",
database="homeassistant"
)

Have also installed phpmyadmin and I am able to see the database will all tables !

Any hint is appreciated.!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions