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
Use the nix path for mysql/mariadb 'basedir'. Fixes#2524 (#2525)
## Summary
As described on #2524, `mysqld` are using the local `/usr` for `basedir`
(e.g. reading `/usr/lib/mysql/plugins` if present), when it should be
using the nix equivalent.
## How was it tested?
Warning: this is untested. I don't know how to recompile flake.nix, so I
cheated and edited the `mysqld` wrapper with `sudo vim $(which mysqld)`.
This patch may be wrong, e.g. I'm not sure if `$out` will be expanded in
those single-quotes.
But if the patch does what I hope, this is the effect it should have:
```
cd /tmp
devbox create mysqltest --template mysql
devbox run mysqld --verbose --help | grep ^basedir
```
With this patch, the command above should print something like:
```
basedir /nix/store/15pzxq00jcraacaxancf3zm6h444azpm-mysql-wrapped/
```
previously it would print:
```
basedir /usr/
```
Also, one can fully launch mysqld, connect with mysql and show the
basedir with:
```sql
mysql> SHOW VARIABLES LIKE '%dir';
+-----------------------------+---------------------------------------------------------------------------------+
| Variable_name | Value |
+-----------------------------+---------------------------------------------------------------------------------+
| basedir | /nix/store/15pzxq00jcraacaxancf3zm6h444azpm-mysql-wrapped/ |
| character_sets_dir | /nix/store/15pzxq00jcraacaxancf3zm6h444azpm-mysql-wrapped/share/mysql/charsets/ |
| datadir | /tmp/mysqltest/.devbox/virtenv/mysql80/data/ |
| innodb_data_home_dir | |
| innodb_doublewrite_dir | |
| innodb_log_group_home_dir | ./ |
| innodb_temp_tablespaces_dir | ./#innodb_temp/ |
| innodb_tmpdir | |
| lc_messages_dir | /nix/store/15pzxq00jcraacaxancf3zm6h444azpm-mysql-wrapped/share/mysql/ |
| plugin_dir | /nix/store/15pzxq00jcraacaxancf3zm6h444azpm-mysql-wrapped/lib/mysql/plugin/ |
| replica_load_tmpdir | /tmp |
| slave_load_tmpdir | /tmp |
| tmpdir | /tmp |
+-----------------------------+---------------------------------------------------------------------------------+
13 rows in set (0.00 sec)
```
The basedir and related paths are now correctly pointing to `/nix/store`
paths, and everything still works!
---------
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]>
0 commit comments