This chapter is about installing a SQL database server, which is needed by Pixelfed.
After checking that the system is up to date, run:
sudo apt install -y mysql-server
sudo systemctl start mysql.service
Access to MySQL command line:
sudo mysql
Copy/paste this line and validate:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
quit
sudo mysql_secure_installation
We answer a serie of questions, validating each time with Enter.
Change at least the blinking examples:
password
Reconnect:
mysql -u root -p
Password is new-root-password.
ALTER USER 'root'@'localhost' IDENTIFIED WITH auth_socket;
Create another MySQL "superuser" to avoid using MySQL root in the future:
CREATE USER 'leguellec'@'localhost' IDENTIFIED BY 'superuser-password';
GRANT ALL PRIVILEGES ON *.* TO 'leguellec'@'localhost' WITH GRANT OPTION;
Create a Pixelfed database:
CREATE DATABASE pixelfed_fediverse_ovh;
Create a MySQL dedicated user:
CREATE USER 'user_pixelfed'@'localhost' IDENTIFIED BY 'user-password';
GRANT ALL PRIVILEGES ON pixelfed_fediverse_ovh.* TO 'user_pixelfed'@'localhost';
FLUSH PRIVILEGES;
quit