Docker-compose check if mysql connection is ready

version: “2.1” services: api: build: . container_name: api ports: – “8080:8080” depends_on: db: condition: service_healthy db: container_name: db image: mysql ports: – “3306” environment: MYSQL_ALLOW_EMPTY_PASSWORD: “yes” MYSQL_USER: “user” MYSQL_PASSWORD: “password” MYSQL_DATABASE: “database” healthcheck: test: [“CMD”, “mysqladmin” ,”ping”, “-h”, “localhost”] timeout: 20s retries: 10 The api container will not start until the db container is healthy … Read more

How do I decide when to use right joins/left joins or inner joins Or how to determine which table is on which side?

Yes, it depends on the situation you are in. Why use SQL JOIN? Answer: Use the SQL JOIN whenever multiple tables must be accessed through an SQL SELECT statement and no results should be returned if there is not a match between the JOINed tables. Reading this original article on The Code Project will help … Read more

Dump all tables in CSV format using ‘mysqldump’

First, I can give you the answer for one table: The trouble with all these INTO OUTFILE or –tab=tmpfile (and -T/path/to/directory) answers is that it requires running mysqldump on the same server as the MySQL server, and having those access rights. My solution was simply to use mysql (not mysqldump) with the -B parameter, inline … Read more

What are the differences between utf8_general_ci and utf8_unicode_ci? [duplicate]

utf8_general_ci is a very simple — and on Unicode, very broken — collation, one that gives incorrect results on general Unicode text. What it does is: converts to Unicode normalization form D for canonical decomposition removes any combining characters converts to upper case This does not work correctly on Unicode, because it does not understand … Read more