Skip to content

Instantly share code, notes, and snippets.

@Gabrielll04
Created June 6, 2024 01:15
Show Gist options
  • Save Gabrielll04/48abdc05180381e21b81b900ebec123f to your computer and use it in GitHub Desktop.
Save Gabrielll04/48abdc05180381e21b81b900ebec123f to your computer and use it in GitHub Desktop.
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
buildInputs = with pkgs; [
mysql80
];
shellHook = ''
mkdir ./data
mkdir ./mysql_socket
mysqld --initialize-insecure --console --datadir="$PWD/data" --user="$WHOAMI"
mysqld --datadir="$PWD/data" --socket="$PWD/mysql_socket/mysql.sock"
'';
# use mysql.sock in another terminal with mysql80:
# mysql -u seu_usuario -p -S your/path/mysql_sockets/mysql.sock
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment