Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| cherry:mysql_notes [2021/11/23 18:01] – créée pierre | cherry:mysql_notes [2021/12/20 17:01] (Version actuelle) – supprimée pierre | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== NOTES SQL ====== | ||
| - | ===== Vrac ===== | ||
| - | <code mysql> | ||
| - | show databases; | ||
| - | show databases like ' | ||
| - | show full processlist; | ||
| - | create database testpierre; | ||
| - | create TABLE user ( id INT PRIMARY KEY NOT NULL, nom VARCHAR(64), | ||
| - | show columns from user; | ||
| - | |||
| - | rename table user to user2; | ||
| - | rename table user2 to user; | ||
| - | |||
| - | INSERT user VALUES(' | ||
| - | select * from user; | ||
| - | |||
| - | ALTER TABLE user MODIFY id INTEGER NOT NULL AUTO_INCREMENT; | ||
| - | |||
| - | delete | ||
| - | |||
| - | SELECT user, | ||
| - | |||
| - | UPDATE mysql.user SET password=PASSWORD(" | ||
| - | GRANT ALL PRIVILEGES ON database_name.* TO ' | ||
| - | FLUSH PRIVILEGES; | ||
| - | |||
| - | UPDATE oc_share SET uid_owner=" | ||
| - | |||
| - | INSERT INTO address (domain_id, address, password, enabled, expire_date, | ||
| - | VALUES (' | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | CREATE USER ' | ||
| - | CREATE USER ' | ||
| - | |||
| - | </ | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | ===== Création d'un utilisateur et d'un DB ===== | ||
| - | <code mysql> | ||
| - | CREATE USER ' | ||
| - | CREATE DATABASE boaconcept_wp; | ||
| - | GRANT ALL PRIVILEGES ON boaconcept_wp.* TO " | ||
| - | FLUSH PRIVILEGES; | ||
| - | </ | ||
| - | |||
| - | ===== Creation d'un utilisateur non-root mais root quand même ===== | ||
| - | use mysql; | ||
| - | GRANT ALL PRIVILEGES ON *.* TO adminmysql@localhost | ||
| - | IDENTIFIED BY ' | ||
| - | FLUSH PRIVILEGES; | ||