Create a ./.env
File:
DATABASE_URL="mysql://<USER>:<PASSWD>@localhost/<DBNAME>"
Install rust-lang:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- DBeaver Database Tool
- sqlx-cli
cargo install sqlx-cli
CREATE USER IF NOT EXISTS '<USER>'@'localhost' IDENTIFIED BY '<PASSWD>';
CREATE OR REPLACE DATABASE `<DBNAME>` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON `<DBNAME>`.* TO '<USER>'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
# export DATABASE_URL=mysql://<USER>:<PASSWD>@localhost/<DBNAME>
# or use .env file
sqlx setup