Commit f775a0d97449de4cd05c3a021fa33ae74f56b210
1 parent
5a686315
Exists in
master
and in
1 other branch
bugfix database install
Showing
10 changed files
with
26 additions
and
26 deletions
Show diff stats
database/create_database.sql
... | ... | @@ -19,19 +19,19 @@ SET time_zone = "+00:00"; |
19 | 19 | /*!40101 SET NAMES utf8mb4 */; |
20 | 20 | |
21 | 21 | -- |
22 | --- Base de données : `mydb` | |
22 | +-- Base de données : `_mydb_` | |
23 | 23 | -- |
24 | 24 | |
25 | -DROP DATABASE IF EXISTS mydb; | |
26 | -CREATE SCHEMA IF NOT EXISTS mydb DEFAULT CHARACTER SET latin1; | |
27 | -CREATE SCHEMA IF NOT EXISTS mydb_test DEFAULT CHARACTER SET latin1; | |
25 | +DROP DATABASE IF EXISTS _mydb_; | |
26 | +CREATE SCHEMA IF NOT EXISTS _mydb_ DEFAULT CHARACTER SET latin1; | |
27 | +CREATE SCHEMA IF NOT EXISTS _mydbtest_ DEFAULT CHARACTER SET latin1; | |
28 | 28 | |
29 | 29 | |
30 | 30 | -- Creation du proprietaire de la BD |
31 | 31 | -- La ligne suivante serait la meilleure, mais ne suffit pas, impossible de se connecter a la BD avec ceci : |
32 | --- grant all on mydb.* to 'bddUserName' identified by 'bddUserPass'; | |
32 | +-- grant all on _mydb_.* to 'bddUserName' identified by 'bddUserPass'; | |
33 | 33 | -- ni avec ceci : |
34 | --- grant all on mydb.* to 'bddUserName'@'%' identified by 'bddUserPass'; | |
34 | +-- grant all on _mydb_.* to 'bddUserName'@'%' identified by 'bddUserPass'; | |
35 | 35 | -- Il faut donc faire ceci (ajouter localhost) et on pourra alors se connecter a la BD !!! : |
36 | 36 | |
37 | 37 | -- Il faut supprimer l'utilisateur avant de l'ajouter. |
... | ... | @@ -44,14 +44,14 @@ CREATE SCHEMA IF NOT EXISTS mydb_test DEFAULT CHARACTER SET latin1; |
44 | 44 | -- GRANT USAGE ON *.* TO 'superadmin'; |
45 | 45 | -- DROP USER 'superadmin'; |
46 | 46 | |
47 | --- grant all on mydb.* to 'mydb'@'localhost' identified by 'mydb1'; | |
48 | -grant all on mydb.* to 'mydb_user'@'localhost' identified by 'mydb_pass'; | |
47 | +-- grant all on _mydb_.* to '_mydb_'@'localhost' identified by '_mydb_1'; | |
48 | +grant all on _mydb_.* to 'mydb_user'@'localhost' identified by 'mydb_pass'; | |
49 | 49 | |
50 | --- grant all on mydb_test.* to 'superadmin'@'localhost' identified by 'superadmin'; | |
51 | -grant all on mydb_test.* to 'mydb_user'@'localhost' identified by 'mydb_pass'; | |
50 | +-- grant all on _mydbtest_.* to 'superadmin'@'localhost' identified by 'superadmin'; | |
51 | +grant all on _mydbtest_.* to 'mydb_user'@'localhost' identified by 'mydb_pass'; | |
52 | 52 | |
53 | 53 | -- Mais, ca serait plus prudent de limiter les droits (au lieu de "grant all"): |
54 | --- grant select,insert,update,delete on mydb.* to ... | |
54 | +-- grant select,insert,update,delete on _mydb_.* to ... | |
55 | 55 | flush privileges; |
56 | 56 | |
57 | 57 | ... | ... |
database/create_database_test.sql
1 | -CREATE SCHEMA IF NOT EXISTS mydb_test DEFAULT CHARACTER SET latin1; | |
1 | +CREATE SCHEMA IF NOT EXISTS _mydbtest_ DEFAULT CHARACTER SET latin1; | |
2 | 2 | |
3 | 3 | GRANT USAGE ON *.* TO 'superadmin'; |
4 | 4 | DROP USER 'superadmin'; |
5 | 5 | |
6 | -grant all on mydb_test.* to 'superadmin'@'localhost' identified by 'superadmin'; | |
6 | +grant all on _mydbtest_.* to 'superadmin'@'localhost' identified by 'superadmin'; | |
7 | 7 | |
8 | 8 | flush privileges; | ... | ... |
database/create_tables.sql
database/create_tables_2019_05.sql
database/insert_fake_users.sql
database/insert_superadmin_user.sql
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 | |
6 | 6 | -- Mot de passe par défaut : login |
7 | 7 | |
8 | -use mydb; | |
8 | +use _mydb_; | |
9 | 9 | |
10 | 10 | INSERT INTO users (nom, username, password, email, role) VALUES |
11 | 11 | ('Nom Prenom', 'userlogin', '$2y$10$LZzpws3oDidBcqO/Fy1RTedLLk3ENTmplny5J7bZ6R1PqFoGOw3Ma', '__@__', 'Super Administrateur'); | ... | ... |
database/insert_tables_default_data_IRAP.sql
... | ... | @@ -6,8 +6,8 @@ |
6 | 6 | -- Contenu de la table 'sur_categories' |
7 | 7 | -- |
8 | 8 | |
9 | --- ATTENTION : remplacer le nom "mydb" par le nom de votre base de donnée | |
10 | -use mydb; | |
9 | +-- ATTENTION : remplacer le nom "_mydb_" par le nom de votre base de donnée | |
10 | +use _mydb_; | |
11 | 11 | |
12 | 12 | INSERT INTO sur_categories (id, nom) VALUES (1, 'Electronique'), |
13 | 13 | (2, 'Informatique'), |
... | ... | @@ -183,4 +183,4 @@ INSERT INTO groupes_thematiques (id, nom, description) VALUES |
183 | 183 | -- contenu deplace dans le fichier requete Insert_Users.sql |
184 | 184 | |
185 | 185 | |
186 | --- | |
187 | 186 | \ No newline at end of file |
187 | +-- | ... | ... |
database/insert_tables_default_data_general.sql
database/labinvent_mode_update.sql
1 | -CREATE SCHEMA IF NOT EXISTS mydb_test DEFAULT CHARACTER SET latin1; | |
1 | +CREATE SCHEMA IF NOT EXISTS _mydbtest_ DEFAULT CHARACTER SET latin1; | |
2 | 2 | |
3 | 3 | GRANT USAGE ON *.* TO 'superadmin'; |
4 | 4 | DROP USER 'superadmin'; |
5 | 5 | |
6 | -grant all on mydb_test.* to 'superadmin'@'localhost' identified by 'superadmin'; | |
6 | +grant all on _mydbtest_.* to 'superadmin'@'localhost' identified by 'superadmin'; | |
7 | 7 | |
8 | 8 | flush privileges; | ... | ... |
install/installation.sh
... | ... | @@ -481,8 +481,8 @@ if [ $BDD == "O" ] ; then |
481 | 481 | fi |
482 | 482 | |
483 | 483 | # Remplacement des "use mydb" par "use $bddName" |
484 | - sed -e "s/mydb/$bddName/" -i ./build.sql | |
485 | - sed -e "s/mydb_test/$bddName_test/" -i ./build.sql | |
484 | + sed -e "s/_mydb_/$bddName/" -i ./build.sql | |
485 | + sed -e "s/_mydbtest_/$bddName_test/" -i ./build.sql | |
486 | 486 | |
487 | 487 | |
488 | 488 | ... | ... |