init scripts to initialize database from the sql dump

This commit is contained in:
Guilhem Fauré 2023-04-14 08:35:47 +00:00
parent fbd669f14a
commit 51b7ab6c5a
2 changed files with 7 additions and 0 deletions

3
init.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
sudo mysql < init.sql
mysql --user=spip --password=password spip < $(realpath "$1")

4
init.sql Normal file
View File

@ -0,0 +1,4 @@
CREATE USER 'spip'@'localhost' IDENTIFIED BY 'password';
CREATE DATABASE IF NOT EXISTS spip CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT ALL PRIVILEGES ON spip.* TO 'spip'@'localhost';
FLUSH PRIVILEGES;