Mysql install failing

I just tried out installing mysql on macos and hit a failure. What’s the next step to figuring out how to get beyond this?

$ nix --version
nix (Nix) 2.1.3
$ nix-env -i mysql-5.7.23
installing 'mysql-5.7.23'
these derivations will be built:
  /nix/store/7rhxlb09ix9ddrpc9l9c7lvxdwgri11a-mysql-5.7.23.drv
these paths will be fetched (73.86 MiB download, 273.52 MiB unpacked):
  /nix/store/0614yg6zd80g1ar3qr54qa0fglfsv0i8-boost-1.59.0-dev
...

In file included from /nix/store/9qji9vx3ixv2q7vphqhjps5hp38vxsf0-protobuf-3.6.1/include/google/protobuf/arena_impl.h:39:
/nix/store/9qji9vx3ixv2q7vphqhjps5hp38vxsf0-protobuf-3.6.1/include/google/protobuf/stubs/common.h:209:17: error: expected expression
  OnShutdownRun([](const void* p) { delete static_cast<const T*>(p); }, p);
                ^
In file included from /tmp/nix-build-mysql-5.7.23.drv-0/mysql-5.7.23/rapid/plugin/x/mysqlxtest_src/message_formatter.cc:20:
In file included from /tmp/nix-build-mysql-5.7.23.drv-0/mysql-5.7.23/rapid/plugin/x/mysqlxtest_src/message_formatter.h:27:
In file included from /tmp/nix-build-mysql-5.7.23.drv-0/mysql-5.7.23/rapid/plugin/x/mysqlxtest_src/mysqlx_protocol.h:46:
In file included from /tmp/nix-build-mysql-5.7.23.drv-0/mysql-5.7.23/rapid/plugin/x/ngs/include/ngs_common/protocol_protobuf.h:25:
In file included from /nix/store/9qji9vx3ixv2q7vphqhjps5hp38vxsf0-protobuf-3.6.1/include/google/protobuf/message.h:119:
/nix/store/9qji9vx3ixv2q7vphqhjps5hp38vxsf0-protobuf-3.6.1/include/google/protobuf/message_lite.h:117:3: error: unknown type name 'constexpr'
  constexpr const T& get() const { return reinterpret_cast<const T&>(union_); }
  ^
/nix/store/9qji9vx3ixv2q7vphqhjps5hp38vxsf0-protobuf-3.6.1/include/google/protobuf/message_lite.h:117:13: error: expected member name or ';' after declaration specifiers
  constexpr const T& get() const { return reinterpret_cast<const T&>(union_); }
  ~~~~~~~~~ ^
/nix/store/9qji9vx3ixv2q7vphqhjps5hp38vxsf0-protobuf-3.6.1/include/google/protobuf/message_lite.h:110:11: error: use of undeclared identifier 'union_'
    new (&union_) T();
          ^
/nix/store/9qji9vx3ixv2q7vphqhjps5hp38vxsf0-protobuf-3.6.1/include/google/protobuf/message_lite.h:114:5: error: use of undeclared identifier 'get_mutable'
    get_mutable()->~T();
    ^
/nix/store/9qji9vx3ixv2q7vphqhjps5hp38vxsf0-protobuf-3.6.1/include/google/protobuf/message_lite.h:131:48: error: found '<::' after a template name which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?
LIBPROTOBUF_EXPORT extern ExplicitlyConstructed<::std::string> fixed_address_empty_string;
                                               ^
/nix/store/9qji9vx3ixv2q7vphqhjps5hp38vxsf0-protobuf-3.6.1/include/google/protobuf/message_lite.h:134:37: error: no member named 'get' in 'google::protobuf::internal::ExplicitlyConstructed<std::__1::basic_string<char> >'
  return fixed_address_empty_string.get();
         ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^

Maybe you have more luck with mariadb?

https://hydra.nixos.org/eval/1484579?filter=mysql&compare=1484538&full=#tabs-still-succeed

$ nix-env -iA mysql

Notice that the -iA will use the attribute, which in turn will install mariadb, which what we put behind the mysql attribute. mysql-5.7.23 is the actual mysql from oracle. Usually you don’t want this variant anyway because of their messed up security update policies.

See also https://github.com/NixOS/nixpkgs/blob/6963bc351194ca902577955b9b02eff1482df02f/pkgs/top-level/all-packages.nix#L13421

Well, the attribute flag didn’t work for me, however installing mariadb did. Thanks!

$ nix-channel --update nixpkgs
unpacking channels...
created 0 symlinks in user environment
ip-192-168-88-186:~ montgomeryzukowski$ nix-env -iA mysql
error: attribute 'mysql' in selection path 'mysql' not found
ip-192-168-88-186:~ montgomeryzukowski$ nix-env -i mariadb
installing 'mariadb-10.2.17'
these paths will be fetched (26.94 MiB download, 207.61 MiB unpacked):
  /nix/store/0smv1fpqv12ih7wgq38xi8ivm2r6703s-gettext-0.19.8.1
  /nix/store/1fcm29rr8y201wb57dx413brchrazgr1-lzo-2.10
  /nix/store/708zxx84n08jillh37im24rlqkvbp7ns-cracklib-2.9.6
  /nix/store/cb8rgkkg1f5b6vp2cq2lfphlfpl0ckrm-snappy-1.1.7
  /nix/store/rxscrc8ylnxmwnk7d52qhizhsjyi4n1r-mariadb-10.2.17
copying path '/nix/store/1fcm29rr8y201wb57dx413brchrazgr1-lzo-2.10' from 'https://cache.nixos.org'...
copying path '/nix/store/cb8rgkkg1f5b6vp2cq2lfphlfpl0ckrm-snappy-1.1.7' from 'https://cache.nixos.org'...
copying path '/nix/store/0smv1fpqv12ih7wgq38xi8ivm2r6703s-gettext-0.19.8.1' from 'https://cache.nixos.org'...
copying path '/nix/store/708zxx84n08jillh37im24rlqkvbp7ns-cracklib-2.9.6' from 'https://cache.nixos.org'...
copying path '/nix/store/rxscrc8ylnxmwnk7d52qhizhsjyi4n1r-mariadb-10.2.17' from 'https://cache.nixos.org'...
building '/nix/store/mmkl3c01y8jamgg879nwlwjnmq8dgzj1-user-environment.drv'...
created 5 symlinks in user environment