SQL
After install
ensure secure access sudo mysql_secure_installation
Logging in
mysql -u USERNAME -p
Creating a user
CREATE USER 'NEW_USERNAME'@'localhost' IDENTIFIED BY 'NEW_PASSWORD';
Creating a database
CREATE DATABASE DATABASE_NAME
Allow user to modify Database
GRANT ALL PRIVILEGES ON DATABASE_NAME.* TO 'USERNAME'@'localhost';
Update permissions
FLUSH PRIVILEGES;
Open Database to the world
- Open file at
/etc/mysql/maridadb.conf.d/50-server.cnf - Edit line
bind-address = 127.0.0.1to ->bind-address = 0.0.0.0 - Restart db service
systemctl restart mariadb - Allow port through firewall with
ufw allow 3306