Skip to content

Commit e3b73ba

Browse files
authored
Update MariaDB + MySQL Plugins (#2672)
## Summary Fix some socket paths and settings that were causing issues Use the MariaDB binaries to avoid a deprecation warning Tested and added support for MySQL84 ## How was it tested? Localhost ## Community Contribution License All community contributions in this pull request are licensed to the project maintainers under the terms of the [Apache 2 License](https://www.apache.org/licenses/LICENSE-2.0). By creating this pull request, I represent that I have the right to license the contributions to the project maintainers under the Apache 2 License as stated in the [Community Contribution License](https://github.com/jetify-com/opensource/blob/main/CONTRIBUTING.md#community-contribution-license).
1 parent cc8c79f commit e3b73ba

File tree

11 files changed

+82
-38
lines changed

11 files changed

+82
-38
lines changed

examples/databases/mariadb/devbox.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@
2121
"commit": "f80ac848e3d6f0c12c52758c0f25c10c97ca3b62"
2222
},
2323
"env": {
24-
"MYSQL_UNIX_PORT": "/tmp/devbox/mariadb/run/mysql.sock"
2524
}
26-
}
25+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# MySQL configuration file
2+
3+
[mariadbd]
4+
# Change this port if 3306 is already used
5+
#port = 3306
6+
log_error=mysql.log
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# MySQL configuration file
2+
3+
# [mysqld]
4+
# skip-log-bin
5+
# Change this port if 3306 is already used
6+
#port = 3306
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# MySQL configuration file
2+
3+
# [mysqld]
4+
# skip-log-bin
5+
# Change this port if 3306 is already used
6+
#port = 3306
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
{
2-
"packages": [
3-
"mysql80@latest"
4-
],
2+
"packages": ["mysql84@latest"],
53
"shell": {
64
"init_hook": [],
75
"scripts": {
86
"connect_db": [
9-
"mysql -u devbox_user -p -D devbox_lamp"
7+
"mysql -u devbox_user -p -D devbox_lamp",
108
],
119
"test_db_setup": [
1210
"mkdir -p /tmp/devbox/mariadb/run",
1311
"devbox services up -b",
1412
"sleep 5",
1513
"mysql -u root --password='' < setup_db.sql",
16-
"devbox services stop"
17-
]
18-
}
14+
"devbox services stop",
15+
],
16+
},
1917
},
20-
"env": {
21-
"MYSQL_UNIX_PORT": "/tmp/devbox/mariadb/run/mysql.sock"
22-
}
23-
}
18+
}

examples/databases/mysql/devbox.lock

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,72 @@
11
{
22
"lockfile_version": "1",
33
"packages": {
4-
"mysql80@latest": {
5-
"last_modified": "2024-02-10T18:15:24Z",
6-
"plugin_version": "0.0.3",
7-
"resolved": "github:NixOS/nixpkgs/10b813040df67c4039086db0f6eaf65c536886c6#mysql80",
4+
"github:NixOS/nixpkgs/nixpkgs-unstable": {
5+
"last_modified": "2025-08-04T20:54:38Z",
6+
"resolved": "github:NixOS/nixpkgs/cab778239e705082fe97bb4990e0d24c50924c04?lastModified=1754340878&narHash=sha256-lgmUyVQL9tSnvvIvBp7x1euhkkCho7n3TMzgjdvgPoU%3D"
7+
},
8+
"mysql84@latest": {
9+
"last_modified": "2025-08-08T11:17:04Z",
10+
"plugin_version": "0.0.4",
11+
"resolved": "github:NixOS/nixpkgs/b069b7c1e2fe1a3a24221428558bf44128d3d5c8#mysql84",
812
"source": "devbox-search",
9-
"version": "8.0.36",
13+
"version": "8.4.6",
1014
"systems": {
1115
"aarch64-darwin": {
1216
"outputs": [
1317
{
1418
"name": "out",
15-
"path": "/nix/store/50hwl7vdz5lqdx3agn9f6q2dibcf8yms-mysql-8.0.36",
19+
"path": "/nix/store/fab2yjsp2nb2vxkf1q9lizbxpvz72g7z-mysql-8.4.6",
1620
"default": true
1721
},
1822
{
1923
"name": "static",
20-
"path": "/nix/store/lhg44jksdla9j4m3g6wmlrrb55j5l3y8-mysql-8.0.36-static"
24+
"path": "/nix/store/gi2cfbf7ma36yys3rphz59apwv798y6w-mysql-8.4.6-static"
2125
}
2226
],
23-
"store_path": "/nix/store/50hwl7vdz5lqdx3agn9f6q2dibcf8yms-mysql-8.0.36"
27+
"store_path": "/nix/store/fab2yjsp2nb2vxkf1q9lizbxpvz72g7z-mysql-8.4.6"
2428
},
2529
"aarch64-linux": {
2630
"outputs": [
2731
{
2832
"name": "out",
29-
"path": "/nix/store/g5kp969zy1mk2g5hdzzg69vw4g4m9sy0-mysql-8.0.36",
33+
"path": "/nix/store/9fnq2ijz65q5q0bvd50279inbhmx9k31-mysql-8.4.6",
3034
"default": true
3135
},
3236
{
3337
"name": "static",
34-
"path": "/nix/store/29zyqbla4d9ax6hyv4myxdiy2xb109g5-mysql-8.0.36-static"
38+
"path": "/nix/store/4nj305bgk0npv8p683s6fnrkr0f7kfy6-mysql-8.4.6-static"
3539
}
3640
],
37-
"store_path": "/nix/store/g5kp969zy1mk2g5hdzzg69vw4g4m9sy0-mysql-8.0.36"
41+
"store_path": "/nix/store/9fnq2ijz65q5q0bvd50279inbhmx9k31-mysql-8.4.6"
3842
},
3943
"x86_64-darwin": {
4044
"outputs": [
4145
{
4246
"name": "out",
43-
"path": "/nix/store/h48pc9is6jw3nxzai5gd025y51c361lj-mysql-8.0.36",
47+
"path": "/nix/store/m53dgvffnpr5xn0phf220qipqpzw04qx-mysql-8.4.6",
4448
"default": true
4549
},
4650
{
4751
"name": "static",
48-
"path": "/nix/store/s030q0ibyw32sa755qygi8m0zyf8qn8s-mysql-8.0.36-static"
52+
"path": "/nix/store/8ki39xjalywa5f83a716bhmva8lh39k9-mysql-8.4.6-static"
4953
}
5054
],
51-
"store_path": "/nix/store/h48pc9is6jw3nxzai5gd025y51c361lj-mysql-8.0.36"
55+
"store_path": "/nix/store/m53dgvffnpr5xn0phf220qipqpzw04qx-mysql-8.4.6"
5256
},
5357
"x86_64-linux": {
5458
"outputs": [
5559
{
5660
"name": "out",
57-
"path": "/nix/store/vwcld5bqs1dg7h2ffcgz8am4vdrxw176-mysql-8.0.36",
61+
"path": "/nix/store/5jkdn4wrr079d5xm14mz0c44fsgqwq4z-mysql-8.4.6",
5862
"default": true
5963
},
6064
{
6165
"name": "static",
62-
"path": "/nix/store/x8rlbq0z80nqldwvxs4w2rblp3yjwn0z-mysql-8.0.36-static"
66+
"path": "/nix/store/c8r41hrvjiim2vyjcqq81nr7z3g8h11x-mysql-8.4.6-static"
6367
}
6468
],
65-
"store_path": "/nix/store/vwcld5bqs1dg7h2ffcgz8am4vdrxw176-mysql-8.0.36"
69+
"store_path": "/nix/store/5jkdn4wrr079d5xm14mz0c44fsgqwq4z-mysql-8.4.6"
6670
}
6771
}
6872
}

examples/databases/mysql/my.cnf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[mysqld]
2+
# Use a different port to avoid conflicts
3+
port = 3307
4+
5+
# Basic settings
6+
datadir = .devbox/virtenv/mysql80/data
7+
pid-file = .devbox/virtenv/mysql80/run/mysql.pid
8+
log-error = .devbox/virtenv/mysql80/run/mysql-error.log
9+
socket = .devbox/virtenv/mysql80/run/mysql.sock
10+
lc_messages_dir = .devbox/virtenv/mysql80/share/mysql/
11+
lc_messages = en_US
12+
13+
# Disable X Plugin which also causes conflicts
14+
mysqlx = 0
15+
16+
# Performance settings
17+
max_connections = 100
18+
key_buffer_size = 16M
19+
max_allowed_packet = 16M
20+
21+
[client]
22+
socket = .devbox/virtenv/mysql80/run/mysql.sock

plugins/builtins.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var builtInMap = map[*regexp.Regexp]string{
3030
regexp.MustCompile(`^elixir_?([0-9_]*[0-9]+)?$`): "elixir",
3131
regexp.MustCompile(`^(ghc|haskell\.compiler\.(.*))$`): "haskell",
3232
regexp.MustCompile(`(^mariadb(-embedded)?_?[0-9]*$|^mysql$)`): "mariadb",
33-
regexp.MustCompile(`^mysql(80|57|50)$`): "mysql",
33+
regexp.MustCompile(`^mysql(8[0-9]|57|50)$`): "mysql",
3434
regexp.MustCompile(`^nodejs(-slim)?_?[0-9]*$`): "nodejs",
3535
regexp.MustCompile(`^php[0-9]*$`): "php",
3636
regexp.MustCompile(`^python3[0-9]*Packages.pip$`): "pip",

plugins/mariadb/process-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ version: "0.5"
22

33
processes:
44
mariadb:
5-
command: "echo 'Starting mysqld... check mariadb_logs for details'; mysqld --log-error=$MYSQL_HOME/mysql.log"
5+
command: "echo 'Starting mysqld... check mariadb_logs for details'; mariadbd --log-error=$MYSQL_HOME/mysql.log"
66
is_daemon: false
77
shutdown:
8-
command: "mysqladmin -u root shutdown"
8+
command: "mariadb-admin -u root shutdown"
99
availability:
1010
restart: "always"
1111
mariadb_logs:

plugins/mysql/flake.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
postBuild = ''
1616
1717
wrapProgram $out/bin/mysqld \
18-
--add-flags '--basedir=$out --datadir=''$MYSQL_DATADIR --pid-file=''$MYSQL_PID_FILE --socket=''$MYSQL_UNIX_PORT';
18+
--add-flags '--basedir=''$MYSQL_BASEDIR --datadir=''$MYSQL_DATADIR --pid-file=''$MYSQL_PID_FILE --socket=''$MYSQL_UNIX_PORT';
1919
2020
wrapProgram $out/bin/mysqld_safe \
21-
--add-flags '--basedir=$out --datadir=''$MYSQL_DATADIR --pid-file=''$MYSQL_PID_FILE --socket=''$MYSQL_UNIX_PORT';
21+
--add-flags '--basedir=''$MYSQL_BASEDIR --datadir=''$MYSQL_DATADIR --pid-file=''$MYSQL_PID_FILE --socket=''$MYSQL_UNIX_PORT';
2222
'';
2323
};
2424
in{

0 commit comments

Comments
 (0)