- Start the mysql server using
devbox services up
- Create a database using
"mysql -u root --password='' < setup_db.sql"
- You can now connect to the database from the command line by running
devbox run connect_db
- mysql
Use devbox services start|stop [service]
to interact with services
- MYSQL_BASEDIR=<projectDir>/.devbox/nix/profile/default
- MYSQL_HOME=<projectDir>/.devbox/virtenv/mysql/run
- MYSQL_DATADIR=<projectDir>/.devbox/virtenv/mysql/data
- MYSQL_UNIX_PORT=<projectDir>/.devbox/virtenv/mysql/run/mysql.sock
- MYSQL_PID_FILE=<projectDir>/.devbox/virtenv/mysql/run/mysql.pid
To show this information, run devbox info mysql
Note that the .sock
filepath can only be maximum 100 characters long. You can point to a different path by setting the MYSQL_UNIX_PORT
env variable in your devbox.json
.