diff --git a/examples/databases/mariadb/README.md b/examples/databases/mariadb/README.md index c377580ac06..02e50799dcf 100644 --- a/examples/databases/mariadb/README.md +++ b/examples/databases/mariadb/README.md @@ -3,7 +3,7 @@ ## mariadb Notes 1. Start the mariadb server using `devbox services up` -1. Create a database using `"mysql -u root < setup_db.sql"` +1. Create a database using `"mysql --socket-path=$MYSQL_UNIX_PORT --password='' < setup_db.sql"` 1. You can now connect to the database from the command line by running `devbox run connect_db` ## Services @@ -22,10 +22,4 @@ Use `devbox services start|stop [service]` to interact with services To show this information, run `devbox info mariadb` -Note that the `.sock` filepath can only be maximum 100 characters long. You can point to a different path by setting the `MYSQL_UNIX_PORT` env variable in your `devbox.json` as follows: - -``` -"env": { - "MYSQL_UNIX_PORT": "//mysql.sock" -} -``` +Note that the `.sock` filepath can only be maximum 100 characters long. You can point to a different path by setting the `MYSQL_UNIX_PORT` env variable in your `devbox.json`. diff --git a/examples/databases/mariadb/devbox.json b/examples/databases/mariadb/devbox.json index 87f70879d99..e4f9c8d2771 100644 --- a/examples/databases/mariadb/devbox.json +++ b/examples/databases/mariadb/devbox.json @@ -10,15 +10,17 @@ ], "test_db_setup": [ "mkdir -p /tmp/devbox/mariadb/run", - "export MYSQL_UNIX_PORT=/tmp/devbox/mariadb/run/mysql.sock", "devbox services up -b", "sleep 5", - "mysql -u root < setup_db.sql", + "mysql -u root --password='' < setup_db.sql", "devbox services stop" ] } }, "nixpkgs": { "commit": "f80ac848e3d6f0c12c52758c0f25c10c97ca3b62" - } + }, + "env": { + "MYSQL_UNIX_PORT": "/tmp/devbox/mariadb/run/mysql.sock" + } } \ No newline at end of file diff --git a/examples/databases/mysql/README.md b/examples/databases/mysql/README.md index 45b69cc59f7..ea6098f017d 100644 --- a/examples/databases/mysql/README.md +++ b/examples/databases/mysql/README.md @@ -3,7 +3,7 @@ ## mysql Notes 1. Start the mysql server using `devbox services up` -1. Create a database using `"mysql -u root < setup_db.sql"` +1. Create a database using `"mysql -u root --password='' < setup_db.sql"` 1. You can now connect to the database from the command line by running `devbox run connect_db` ## Services @@ -22,10 +22,4 @@ Use `devbox services start|stop [service]` to interact with services To show this information, run `devbox info mysql` -Note that the `.sock` filepath can only be maximum 100 characters long. You can point to a different path by setting the `MYSQL_UNIX_PORT` env variable in your `devbox.json` as follows: - -```json -"env": { - "MYSQL_UNIX_PORT": "//mysql.sock" -} -``` +Note that the `.sock` filepath can only be maximum 100 characters long. You can point to a different path by setting the `MYSQL_UNIX_PORT` env variable in your `devbox.json`. diff --git a/examples/databases/mysql/devbox.json b/examples/databases/mysql/devbox.json index 4fc8e388a3b..1465d180b6e 100644 --- a/examples/databases/mysql/devbox.json +++ b/examples/databases/mysql/devbox.json @@ -10,12 +10,14 @@ ], "test_db_setup": [ "mkdir -p /tmp/devbox/mariadb/run", - "export MYSQL_UNIX_PORT=/tmp/devbox/mariadb/run/mysql.sock", "devbox services up -b", "sleep 5", - "mysql -u root < setup_db.sql", + "mysql -u root --password='' < setup_db.sql", "devbox services stop" ] } - } + }, + "env": { + "MYSQL_UNIX_PORT": "/tmp/devbox/mariadb/run/mysql.sock" + } } \ No newline at end of file