Skip to content

Commit

Permalink
Use tcp instead of socket for db scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
fodor0205 committed Feb 25, 2024
1 parent 48e54f5 commit 4a0257f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,18 @@ import-osm-data-to-postgres:

.PHONY: mysql-drop-db
mysql-drop-db:
MYSQL_PWD="$(mysql-root-password)" mysql --user root < db/mysql/mysql-drop-db.sql
MYSQL_PWD="$(mysql-root-password)" mysql --host 127.0.0.1 \
--user root < db/mysql/mysql-drop-db.sql


# Need to create user with cli command, using variable password in sql script is not easy
.PHONY: mysql-create-db
mysql-create-db:
MYSQL_PWD="$(mysql-root-password)" mysql --user root \
MYSQL_PWD="$(mysql-root-password)" mysql --host 127.0.0.1 \
--user root \
--execute "CREATE USER IF NOT EXISTS osmhu IDENTIFIED BY '$(mysql-password)';" && \
MYSQL_PWD="$(mysql-root-password)" mysql --user root < db/mysql/mysql-create-db.sql
MYSQL_PWD="$(mysql-root-password)" mysql --host 127.0.0.1 \
--user root < db/mysql/mysql-create-db.sql


.PHONY: mysql-init-empty
Expand Down

0 comments on commit 4a0257f

Please sign in to comment.