Skip to content

Using MySQL by default instead of SQLite

fan-droide edited this page Oct 23, 2025 · 2 revisions

Install MySQL for macOS

brew install mysql

mysql.server start

mysql -u root -p

Install MySQL for Linux

sudo apt install mysql-server
sudo apt install python3-dev libmysqlclient-dev

# See NOTE 1 in case of errors

service mysql start

sudo mysql -u root -p

Install MySQL for Windows

# Install MySQL server from here: 
https://dev.mysql.com/downloads/installer/

# See NOTE 2 for more info:

mysql -u root -p

Create the local database

# Create a DB and add new user (mysqluser) at localhost. 
# Choose your own user name if you want to.
create database hiaudio ; 
CREATE USER 'mysqluser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON hiaudio.* TO 'mysqluser'@'localhost';
FLUSH PRIVILEGES;

mysql > exit

Edit config.py with the following fields

# In config.py fill the following details:
MYSQL_HOST="localhost"
MYSQL_USER="mysqluser"
MYSQL_PASS="password"
MYSQL_DB="hiaudio"

Install python mysqlclient library

pip install mysqlclient

NOTES:

1- In case pip install mysqlclient fails for Linux, try the following commands:

sudo apt install build-essential

sudo apt-get install libmariadb-dev

sudo apt-get install pkg-config

2- MySQL Installation on Windows: https://www.w3schools.com/mysql/mysql_install_windows.asp

Clone this wiki locally