tutoriel : configurer une base de données mysql

1. Installer un service de base de données  mysql pour php
apt-get install php5-mysql mysql-server
2. Configurer une base de données mysql pour wordpress

Pour cet exemple, on configure la base base001.

On choisira base1 comme préfixe des enregistrements dans la table.

username@debian:/var/www/html/base1$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7475
Server version: 5.5.53-0+deb8u1 (Debian)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> USE mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> CREATE DATABASE base001
-> ;
Query OK, 1 row affected (0.00 sec)

mysql> USE base001;
Database changed
mysql> GRANT ALL PRIVILEGES ON base001.* TO 'username'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> Bye
username@debian:/var/www/html/base1$ mysql -u username -p base001
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7483
Server version: 5.5.53-0+deb8u1 (Debian)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SHOW TABLES
-> ;
Empty set (0.00 sec)

mysql>

Archiver par précaution l’ensemble des autres bases de données

username@debian:/var/www/html/base1$ mysqldump -u root -p autre-base-de-données > /home/username/wordpress-ref-install/20xx-xx-xx-autre-base-de-données.sql
Enter password:
username@debian:/var/www/html/base1$ ls -lt ~/wordpress-ref-install
total 10756
-rw-r--r-- 1 username username 1791019 déc. 19 19:09 2016-12-19-autre-base-de-données.sql
-rw-r--r-- 1 username username 9216173 déc. 8 13:00 wordpress-xx.xx-fr_FR.zip
username@debian:/var/www/html/base1$