You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the mysql/mariadb templates, set MYSQL_UNIX_PORT to a hardcoded short path (#2523)
..rather than plugin's project-relative path, to avoid triggering 'The
socket file path is too long (> 107)' error on start. Also specify the
(blank) password in 'test_db_setup'. Fixes#2521
## How was it tested?
Per the description in #2521, after this change `mysqld` should come up
in a >107 length path, e.g.:
```
cd ~/src/github.com/jetify-com/devbox/examples/databases/mysql
devbox services up -b
tail -1 .devbox/compose.log # This shows the socket path, which should now be /tmp/devbox/mariadb/run/mysql.sock
devbox run mysql -u root -p # Blank password - connects
```
Note: I have patched mysql and mariadb because they are essentially the
same. However whereas `mysql` respects the `MYSQL_UNIX_PORT` env
variable, `mysql` from the mariadb package does not (logged as #2522),
so the last step of this code fails:
```
cd ~/src/github.com/jetify-com/devbox/examples/databases/mariadb
devbox services up -b
tail -1 .devbox/compose.log # This shows the socket path, which should now be /tmp/devbox/mariadb/run/mysql.sock
devbox run mysql -u root -p # ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2)
```
Aside from testing, this mariadb bug is irrelevant to this patch. I just
thought I'd mention it.
---------
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: John Lago <[email protected]>
Co-authored-by: Artem Klevtsov <[email protected]>
Co-authored-by: Greg Curtis <[email protected]>
Co-authored-by: Daniel Loreto <[email protected]>
Co-authored-by: Mike Landau <[email protected]>
Co-authored-by: John Lago <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Will Brennan <[email protected]>
Copy file name to clipboardexpand all lines: examples/databases/mariadb/README.md
+2-8
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
## mariadb Notes
4
4
5
5
1. Start the mariadb server using `devbox services up`
6
-
1. Create a database using `"mysql -u root < setup_db.sql"`
6
+
1. Create a database using `"mysql --socket-path=$MYSQL_UNIX_PORT --password='' < setup_db.sql"`
7
7
1. You can now connect to the database from the command line by running `devbox run connect_db`
8
8
9
9
## Services
@@ -22,10 +22,4 @@ Use `devbox services start|stop [service]` to interact with services
22
22
23
23
To show this information, run `devbox info mariadb`
24
24
25
-
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:
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`.
Copy file name to clipboardexpand all lines: examples/databases/mysql/README.md
+2-8
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
## mysql Notes
4
4
5
5
1. Start the mysql server using `devbox services up`
6
-
1. Create a database using `"mysql -u root < setup_db.sql"`
6
+
1. Create a database using `"mysql -u root --password='' < setup_db.sql"`
7
7
1. You can now connect to the database from the command line by running `devbox run connect_db`
8
8
9
9
## Services
@@ -22,10 +22,4 @@ Use `devbox services start|stop [service]` to interact with services
22
22
23
23
To show this information, run `devbox info mysql`
24
24
25
-
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:
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`.
0 commit comments