I am using podman to host and run mysql server. I have defined and created a container using the following terminal command:
podman run --name techBlog -e MYSQL_ROOT_PASSWORD='my-password' -e MYSQL_DATABASE='blog_db' -d mysql:latest
but when I attempt to run my server.js script it returns:
original: Error: connect ECONNREFUSED ::1:3306
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
errno: -4078,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '::1',
port: 3306,
fatal: true
}
I have made sure that my database name, password, and port are correct. The code worked when I has mysql hard installed and I am am unsure why it does not work anymore with podman hosting.
I expected upon creation of the podman container that I would be able to run my server.js file and connect to the mysql server.