This repository contains scripts for managing MySQL server instances on Project IDX workspaces. The provided scripts allow you to start and stop MySQL server easily.
Note
If run MariaDB is enough for You. Add services.mysql
below your packages.
Update 6 June 2024. Now you can run MySQL or MariaDB as service on Project IDX.
packages = [
...
];
# See: https://wiki.nixos.org/wiki/Mysql
services.mysql = {
enable = true;
package = pkgs.mariadb;
# package = pkgs.mysql80; # For MySQL 8.0
};
# Sets environment variables in the workspace
env = {};
Thank for the insight through this video.
To use these scripts, see the video or follow the instructions below:
Before using these scripts, ensure you have the following installed:
-
MySQL Server: Make sure MySQL server is installed on your workspace.
-
Git: Install Git on your workspace to clone this repository.
-
Install MySQL on Project IDX by editing the
dev.nix
file in the.idx
folder, addpkgs.mysql80
to the packages list:packages = [ # other packages pkgs.mysql80 ];
-
Clone this repository to your local machine:
git clone https://github.com/arifnd/mysql-project-idx.git mysql
To start the MySQL server, run the following command:
./mysql/start.sh
If you want to force start the server, you can use the --force
option:
./mysql/start.sh --force
If you want to start the server in the background, use the -d option:
./mysql/start.sh -d
To get the MySQL server status, run the following command:
./mysql/status.sh
To login to MySQL server, run the following command:
mysql -S mysql/data/mysql.sock -u root -p
password 123456
To stop the MySQL server, run the following command:
./mysql/stop.sh
Running the command above will delete your MySQL data.
This project is licensed under the MIT License - see the LICENSE file for details.