Docker MySQL connection DBeaver

For those who are running DB on different machine, you can do the following: First, from where the container is, run docker ps to get the containers details including the Container ID [root@test-001 ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1b02333fb3b9 tutum/nginx “/usr/sbin/nginx” 6 weeks ago Up 7 days 0.0.0.0:80->80/tcp docker_nginx_1 … Read more

nodejs mysql Error: Connection lost The server closed the connection

Try to use this code to handle server disconnect: var db_config = { host: ‘localhost’, user: ‘root’, password: ”, database: ‘example’ }; var connection; function handleDisconnect() { connection = mysql.createConnection(db_config); // Recreate the connection, since // the old one cannot be reused. connection.connect(function(err) { // The server is either down if(err) { // or restarting … Read more

Right query to get the current number of connections in a PostgreSQL DB

Those two requires aren’t equivalent. The equivalent version of the first one would be: SELECT sum(numbackends) FROM pg_stat_database; In that case, I would expect that version to be slightly faster than the second one, simply because it has fewer rows to count. But you are not likely going to be able to measure a difference. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)