Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
elearning:workbooks:mysql:my05 [2021/11/01 15:52] adminelearning:workbooks:mysql:my05 [2022/11/08 15:17] (Version actuelle) admin
Ligne 98: Ligne 98:
  
   # mysql –u –root –p –default_character_set=latin1 dbname < backup.sql [Entrée]   # mysql –u –root –p –default_character_set=latin1 dbname < backup.sql [Entrée]
 +  
 +====Mariabackup====
 +
 +<code>
 +[root@centos7 ~]# curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
 +[info] Checking for script prerequisites.
 +[info] Repository file successfully written to /etc/yum.repos.d/mariadb.repo
 +[info] Adding trusted package signing keys...
 +/etc/pki/rpm-gpg ~
 +~
 +[info] Successfully added trusted package signing keys
 +[info] Cleaning package cache...
 +Loaded plugins: fastestmirror, langpacks
 +Cleaning repos: base extras mariadb-main mariadb-maxscale mariadb-tools updates
 +Cleaning up list of fastest mirrors
 +</code>
 +
 +<code>
 +[root@centos7 ~]# yum install MariaDB-backup
 +</code>
 +
 +<code>
 +[root@centos7 ~]# wget http://downloads.mysql.com/docs/sakila-db.tar.gz
 +</code>
 +
 +<code>
 +[root@centos7 ~]# tar xvf sakila-db.tar.gz
 +</code>
 +
 +<code>
 +[root@centos7 ~]# mysql -uroot -p < sakila-db/sakila-schema.sql 
 +Enter password: 
 +[root@centos7 ~]# mysql -uroot -p < sakila-db/sakila-data.sql
 +Enter password: 
 +</code>
 +
 +<code>
 +[root@centos7 ~]# mkdir /var/mariadb
 +</code>
 +
 +<code>
 +[root@centos7 ~]# mariabackup --backup --target-dir=/var/mariadb/backup/ --user=root --password=fenestros
 +.....
 +[00] 2021-11-03 16:28:35 >> log scanned up to (5455954)
 +[00] 2021-11-03 16:28:35 Executing BACKUP STAGE END
 +[00] 2021-11-03 16:28:35 All tables unlocked
 +[00] 2021-11-03 16:28:35 Copying ib_buffer_pool to /var/mariadb/backup/ib_buffer_pool
 +[00] 2021-11-03 16:28:35         ...done
 +[00] 2021-11-03 16:28:35 Backup created in directory '/var/mariadb/backup/'
 +[00] 2021-11-03 16:28:35 Writing backup-my.cnf
 +[00] 2021-11-03 16:28:35         ...done
 +[00] 2021-11-03 16:28:35 Writing xtrabackup_info
 +[00] 2021-11-03 16:28:35         ...done
 +[00] 2021-11-03 16:28:35 Redo log (from LSN 42161 to 5455954) was copied.
 +[00] 2021-11-03 16:28:35 completed OK!
 +</code>
 +
 +<code>
 +[root@centos7 ~]# ls -l /var/mariadb/backup/
 +total 18040
 +-rw-r-----. 1 root root   425984 Nov  3 16:28 aria_log.00000001
 +-rw-r-----. 1 root root       52 Nov  3 16:28 aria_log_control
 +-rw-r-----. 1 root root      297 Nov  3 16:28 backup-my.cnf
 +-rw-r-----. 1 root root      942 Nov  3 16:28 ib_buffer_pool
 +-rw-r-----. 1 root root 12582912 Nov  3 16:28 ibdata1
 +-rw-r-----. 1 root root  5416448 Nov  3 16:28 ib_logfile0
 +drwx------. 2 root root     4096 Nov  3 16:28 mysql
 +drwx------. 2 root root       19 Nov  3 16:28 performance_schema
 +drwx------. 2 root root     4096 Nov  3 16:28 sakila
 +drwx------. 2 root root     8192 Nov  3 16:28 sys
 +drwx------. 2 root root       19 Nov  3 16:28 test
 +-rw-r-----. 1 root root       75 Nov  3 16:28 xtrabackup_checkpoints
 +-rw-r-----. 1 root root      448 Nov  3 16:28 xtrabackup_info
 +</code>
 +
 +<code>
 +[root@centos7 ~]# mysql -u root -p
 +Enter password: 
 +Welcome to the MariaDB monitor.  Commands end with ; or \g.
 +Your MariaDB connection id is 19
 +Server version: 10.6.4-MariaDB MariaDB Server
 +
 +Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
 +
 +Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 +
 +MariaDB [(none)]> CREATE DATABASE world;
 +Query OK, 1 row affected (0.001 sec)
 +
 +MariaDB [(none)]> exit
 +Bye
 +
 +[root@centos7 ~]# wget http://downloads.mysql.com/docs/world-db.tar.gz
 +
 +[root@centos7 ~]# gunzip world-db.tar.gz 
 +
 +[root@centos7 ~]# ls -l
 +total 44500
 +-rw-------. 1 root root     1200 Apr 30  2016 anaconda-ks.cfg
 +-rw-------. 1 root root     1251 Apr 30  2016 initial-setup-ks.cfg
 +-rwxrwxrwx. 1 root root 19081806 Jan 24  2016 Remote Access-linux64-offline
 +-rw-r--r--. 1 root root 19087360 Jan 24  2016 Remote Access-linux64-offline.tar
 +-rwxrwxrwx. 1 root root  3121044 Jan 24  2016 Remote Access-linux64-online
 +-rw-r--r--. 1 root root  3123200 Jan 24  2016 Remote Access-linux64-online.tar
 +drwxr-xr-x. 2  500  500       69 Nov  1 00:05 sakila-db
 +-rw-r--r--. 1 root root   732133 Nov  1 00:05 sakila-db.tar.gz
 +-rw-r--r--. 1 root root   409600 Nov  1 00:05 world-db.tar
 +
 +[root@centos7 ~]# tar xvf world-db.tar 
 +world-db/
 +world-db/world.sql
 +
 +[root@centos7 ~]# mysql -uroot -p world < world-db/world.sql
 +Enter password: 
 +</code>
 +
 +<code>
 +[root@centos7 ~]# mariabackup --backup --target-dir=/var/mariadb/inc1/ --incremental-basedir=/var/mariadb/backup/ --user=root --password=fenestros
 +</code>
 +
 +<code>
 +[root@centos7 ~]# cat /var/mariadb/backup/xtrabackup_checkpoints 
 +backup_type = full-backuped
 +from_lsn = 0
 +to_lsn = 42161
 +last_lsn = 5455954
 +</code>
 +
  
  
Ligne 176: Ligne 304:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Imporatnt** - Dans le cas de deux machines physiques, cette commande doit être saisie sur le maître **et** l'esclave. Le compte doit avoir les droits de REPLICATION SLAVE (avant MySQL 4.0.2, il devait avoir les droits de FILE). Le mot de passe **password** est à modifier mais doit être identique sur le serveur maître et le serveur esclave.+**Important** - Dans le cas de deux machines physiques, cette commande doit être saisie sur le maître **et** l'esclave. Le compte doit avoir les droits de REPLICATION SLAVE (avant MySQL 4.0.2, il devait avoir les droits de FILE). Le mot de passe **password** est à modifier mais doit être identique sur le serveur maître et le serveur esclave.
 </WRAP> </WRAP>
  
Ligne 204: Ligne 332:
 MariaDB [mysql]>  MariaDB [mysql]> 
 </code> </code>
- 
-===Création d'un clone de la VM=== 
- 
-Arrêtez votre VM : 
- 
-<code> 
-MariaDB [mysql]> exit 
-Bye 
-[root@centos7 ~]# shutdown -h now 
-</code> 
- 
-Créez deux clônes, **maitre** et **esclave** dans VirtualBox. 
  
 ===Configurer le maître=== ===Configurer le maître===
- 
-<WRAP center round todo 60%> 
-Pour chacune des VM maître et esclave, configurez l'interface Carte 1 en mode **Réseau Interne** (//Intnet//) via l'interface %%VirtualBox%% de votre système d'exploitation hôte.  
-</WRAP> 
- 
-Lancez la VM **maître**. 
- 
-Configurez la carte réseau en adresse IP fixe : 
- 
-<code> 
-[root@centos7 ~]# nmcli connection add con-name ip_fixe ifname enp0s3 type ethernet ip4 192.168.1.10/24 gw4 10.0.2.2 
-Connection 'ip_fixe' (79198de5-9ea5-4598-8802-432f624d29df) successfully added. 
-[root@centos7 ~]# nmcli connection up ip_fixe 
-Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/5) 
-[root@centos7 ~]# ip addr 
-1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1 
-    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 
-    inet 127.0.0.1/8 scope host lo 
-       valid_lft forever preferred_lft forever 
-    inet6 ::1/128 scope host  
-       valid_lft forever preferred_lft forever 
-2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 
-    link/ether 08:00:27:03:97:dd brd ff:ff:ff:ff:ff:ff 
-    inet 192.168.1.10/24 brd 192.168.1.255 scope global enp0s3 
-       valid_lft forever preferred_lft forever 
-    inet6 fe80::fbf4:c1e0:8f0e:80b/64 scope link  
-       valid_lft forever preferred_lft forever 
-</code> 
  
 Ajoutez ensuite deux lignes dans la section **mysqld** du fichier **/etc/my.cnf** du maître: Ajoutez ensuite deux lignes dans la section **mysqld** du fichier **/etc/my.cnf** du maître:
Ligne 297: Ligne 385:
 ===Configurer l'esclave=== ===Configurer l'esclave===
  
-Lancez la VM **esclave**.+Connectez-vous à la VM **esclave** au 10.0.2.71. Vérifiez que vous voyez le maître sur le réseau :
  
 <code> <code>
-[root@centos7 ~]# nmcli connection add con-name ip_fixe ifname enp0s3 type ethernet ip4 192.168.1.11/24 gw4 10.0.2.2 +[root@centos7 ~]# ping -c3 10.0.2.51 
-Connection 'ip_fixe' (35825b77-2829-4f38-9b32-13b07bfdf7dasuccessfully added+PING 10.0.2.51 (10.0.2.51) 56(84bytes of data
-[root@centos7 ~]# nmcli connection up ip_fixe +64 bytes from 10.0.2.51icmp_seq=1 ttl=64 time=2.40 ms 
-Connection successfully activated (D-Bus active path/org/freedesktop/NetworkManager/ActiveConnection/5) +64 bytes from 10.0.2.51icmp_seq=2 ttl=64 time=1.52 ms 
-[root@centos7 ~]# ip addr +64 bytes from 10.0.2.51icmp_seq=3 ttl=64 time=1.49 ms 
-1lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen + 
-    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 +--- 10.0.2.51 ping statistics --- 
-    inet 127.0.0.1/8 scope host lo +3 packets transmitted3 received0% packet losstime 2003ms 
-       valid_lft forever preferred_lft forever +rtt min/avg/max/mdev = 1.493/1.809/2.407/0.425 ms
-    inet6 ::1/128 scope host  +
-       valid_lft forever preferred_lft forever +
-2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 +
-    link/ether 08:00:27:03:97:dd brd ff:ff:ff:ff:ff:ff +
-    inet 192.168.1.11/24 brd 192.168.1.255 scope global enp0s3 +
-       valid_lft forever preferred_lft forever +
-    inet6 fe80::41c9:8520:1894:27b7/64 scope link  +
-       valid_lft forever preferred_lft forever+
 </code> </code>
  
-Vérifiez que vous voyez le maître sur le réseau :+Installez MariaDB puis : 
 + 
 +  * configurez le SSL 
 +  * configurez les logs 
 + 
 +La base de données du Maître doit être transférée sur l'Esclave. Afin de permettre une sauvegarde complète des bases de données sur le maître, vous devez vous assurer que seulement root y a accès. Ceci est possible grâce à la directive **max_connections**. 
 + 
 +Contrôlez d'abord la valeur actuelle de **max_connections**:
  
 <code> <code>
-[root@centos7 ~]# ping -c3 192.168.1.10 +[root@centos7 ~]# mysql -u root -p mysql 
-PING 192.168.1.10 (192.168.1.10) 56(84) bytes of data. +Enter password:  
-64 bytes from 192.168.1.10icmp_seq=1 ttl=64 time=2.40 ms +Reading table information for completion of table and column names 
-64 bytes from 192.168.1.10: icmp_seq=2 ttl=64 time=1.52 ms +You can turn off this feature to get a quicker startup with -A
-64 bytes from 192.168.1.10: icmp_seq=3 ttl=64 time=1.49 ms+
  
---- 192.168.1.10 ping statistics --- +Welcome to the MariaDB monitor.  Commands end with ; or \g. 
-3 packets transmitted, 3 received, 0% packet loss, time 2003ms +Your MariaDB connection id is 2 
-rtt min/avg/max/mdev = 1.493/1.809/2.407/0.425 ms+Server version: 5.5.56-MariaDB MariaDB Server 
 + 
 +Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. 
 + 
 +Type 'help;' or '\h' for helpType '\c' to clear the current input statement. 
 + 
 +MariaDB [mysql]> SHOW VARIABLES LIKE 'max_connections'; 
 ++-----------------+-------+ 
 +| Variable_name   | Value | 
 ++-----------------+-------+ 
 +| max_connections | 151   | 
 ++-----------------+-------+ 
 +1 row in set (0.00 sec) 
 + 
 +MariaDB [mysql]>  
 +</code> 
 + 
 +Notez la valeur et ensuite définissez-la à 1 pour n'avoir que la connexion de root : 
 + 
 +<code> 
 +MariaDB [mysql]> SET GLOBAL max_connections = 1
 +Query OK, 0 rows affected 
 + 
 +MariaDB [mysql]> SHOW VARIABLES LIKE 'max_connections'; 
 ++-----------------+-------+ 
 +| Variable_name   | Value | 
 ++-----------------+-------+ 
 +| max_connections | 1     | 
 ++-----------------+-------+ 
 +1 row in set (0.00 sec) 
 + 
 +MariaDB [mysql]>  
 +</code> 
 + 
 +Pour sauvegarder la totalité des bases de données sur le maître, il convient d'utiliser la commande suivante : 
 + 
 +  # mysqldump --user=root --password=fenestros1 --extended-insert --all-databases --master-data --event  > /tmp/backup.sql [Entrée] 
 + 
 +<WRAP center round important 60%> 
 +**Important** - Notez que **--master-data** permet à mysqldump de récupérer les données du maître concernant la réplication. 
 +</WRAP> 
 + 
 +Ensuite sur l'esclave, il convient d'injecter le fichier backup.sql en provenance du maître: 
 + 
 +  # mysql --user=root --password=fenestros < /tmp/backup.sql [Entrée] 
 + 
 +Dernièrement, re-définissez à 151 connexions la valeur de **max-connexions** sur le maître et ensuite contrôlez la valeur de **max_connections**: 
 + 
 +<code> 
 +MariaDB [mysql]> SET GLOBAL max_connections = 151; 
 +Query OK, 0 rows affected (0.01 sec) 
 + 
 +MariaDB [mysql]> SHOW VARIABLES LIKE 'max_connections'; 
 ++-----------------+-------+ 
 +| Variable_name   | Value | 
 ++-----------------+-------+ 
 +| max_connections | 151   | 
 ++-----------------+-------+ 
 +1 row in set (0.37 sec) 
 + 
 +MariaDB [mysql]> 
 </code> </code>
  
Ligne 413: Ligne 559:
 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  
-MariaDB [mysql]> CHANGE MASTER TO MASTER_HOST ='192.168.1.10';+MariaDB [mysql]> CHANGE MASTER TO MASTER_HOST ='10.0.2.51';
 Query OK, 0 rows affected (0.39 sec) Query OK, 0 rows affected (0.39 sec)
  
Ligne 436: Ligne 582:
  
 4 4
-192.168.1.10+10.0.2.51
 replicant replicant
 password password
Ligne 518: Ligne 664:
 | Slave_IO_State       | Master_Host  | Master_User | Master_Port | Connect_Retry | Master_Log_File | Read_Master_Log_Pos | Relay_Log_File | Relay_Log_Pos | Relay_Master_Log_File | Slave_IO_Running | Slave_SQL_Running | Replicate_Do_DB | Replicate_Ignore_DB | Replicate_Do_Table | Replicate_Ignore_Table | Replicate_Wild_Do_Table | Replicate_Wild_Ignore_Table | Last_Errno | Last_Error | Skip_Counter | Exec_Master_Log_Pos | Relay_Log_Space | Until_Condition | Until_Log_File | Until_Log_Pos | Master_SSL_Allowed | Master_SSL_CA_File | Master_SSL_CA_Path | Master_SSL_Cert | Master_SSL_Cipher | Master_SSL_Key | Seconds_Behind_Master | Master_SSL_Verify_Server_Cert | Last_IO_Errno | Last_IO_Error                                                                                                                                             | Last_SQL_Errno | Last_SQL_Error | Replicate_Ignore_Server_Ids | Master_Server_Id | | Slave_IO_State       | Master_Host  | Master_User | Master_Port | Connect_Retry | Master_Log_File | Read_Master_Log_Pos | Relay_Log_File | Relay_Log_Pos | Relay_Master_Log_File | Slave_IO_Running | Slave_SQL_Running | Replicate_Do_DB | Replicate_Ignore_DB | Replicate_Do_Table | Replicate_Ignore_Table | Replicate_Wild_Do_Table | Replicate_Wild_Ignore_Table | Last_Errno | Last_Error | Skip_Counter | Exec_Master_Log_Pos | Relay_Log_Space | Until_Condition | Until_Log_File | Until_Log_Pos | Master_SSL_Allowed | Master_SSL_CA_File | Master_SSL_CA_Path | Master_SSL_Cert | Master_SSL_Cipher | Master_SSL_Key | Seconds_Behind_Master | Master_SSL_Verify_Server_Cert | Last_IO_Errno | Last_IO_Error                                                                                                                                             | Last_SQL_Errno | Last_SQL_Error | Replicate_Ignore_Server_Ids | Master_Server_Id |
 +----------------------+--------------+-------------+-------------+---------------+-----------------+---------------------+----------------+---------------+-----------------------+------------------+-------------------+-----------------+---------------------+--------------------+------------------------+-------------------------+-----------------------------+------------+------------+--------------+---------------------+-----------------+-----------------+----------------+---------------+--------------------+--------------------+--------------------+-----------------+-------------------+----------------+-----------------------+-------------------------------+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+----------------+----------------+-----------------------------+------------------+ +----------------------+--------------+-------------+-------------+---------------+-----------------+---------------------+----------------+---------------+-----------------------+------------------+-------------------+-----------------+---------------------+--------------------+------------------------+-------------------------+-----------------------------+------------+------------+--------------+---------------------+-----------------+-----------------+----------------+---------------+--------------------+--------------------+--------------------+-----------------+-------------------+----------------+-----------------------+-------------------------------+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+----------------+----------------+-----------------------------+------------------+
-| Connecting to master | 192.168.1.10 | replicant          3306 |            60 |                                   4 | relay.000001               4 |                       | Connecting       | Yes                                                                      |                        |                                                              0 |            |            0 |                   0 |             245 | None            |                |             0 | No                                    |                    |                                                  |                  NULL | No                            |          2003 | error connecting to master 'replicant@192.168.1.10:3306' - retry-time: 60  retries: 86400  message: Can't connect to MySQL server on '192.168.1.10' (113) |              0 |                |                                            0 |+| Connecting to master | 10.0.2.51 | replicant          3306 |            60 |                                   4 | relay.000001               4 |                       | Connecting       | Yes                                                                      |                        |                                                              0 |            |            0 |                   0 |             245 | None            |                |             0 | No                                    |                    |                                                  |                  NULL | No                            |          2003 | error connecting to master 'replicant@10.0.2.51:3306' - retry-time: 60  retries: 86400  message: Can't connect to MySQL server on '10.0.2.51' (113) |              0 |                |                                            0 |
 +----------------------+--------------+-------------+-------------+---------------+-----------------+---------------------+----------------+---------------+-----------------------+------------------+-------------------+-----------------+---------------------+--------------------+------------------------+-------------------------+-----------------------------+------------+------------+--------------+---------------------+-----------------+-----------------+----------------+---------------+--------------------+--------------------+--------------------+-----------------+-------------------+----------------+-----------------------+-------------------------------+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+----------------+----------------+-----------------------------+------------------+ +----------------------+--------------+-------------+-------------+---------------+-----------------+---------------------+----------------+---------------+-----------------------+------------------+-------------------+-----------------+---------------------+--------------------+------------------------+-------------------------+-----------------------------+------------+------------+--------------+---------------------+-----------------+-----------------+----------------+---------------+--------------------+--------------------+--------------------+-----------------+-------------------+----------------+-----------------------+-------------------------------+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+----------------+----------------+-----------------------------+------------------+
 1 row in set (0.00 sec) 1 row in set (0.00 sec)
Ligne 620: Ligne 766:
 </code> </code>
  
-=====Annexe #1===== 
  
-Dans le cas de deux machines physiques, la base de données du Maître doit être transférer sur l'Esclave. Afin de permettre une sauvegarde complète des bases de données sur le maître, vous devez vous assurer que seulement root y a accès. Ceci est possible grâce à la directive **max_connections**. 
  
-Contrôlez d'abord la valeur actuelle de **max_connections**: 
  
-<code> 
-[root@centos7 ~]# mysql -u root -p mysql 
-Enter password:  
-Reading table information for completion of table and column names 
-You can turn off this feature to get a quicker startup with -A 
- 
-Welcome to the MariaDB monitor.  Commands end with ; or \g. 
-Your MariaDB connection id is 2 
-Server version: 5.5.56-MariaDB MariaDB Server 
- 
-Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. 
- 
-Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 
- 
-MariaDB [mysql]> SHOW VARIABLES LIKE 'max_connections'; 
-+-----------------+-------+ 
-| Variable_name   | Value | 
-+-----------------+-------+ 
-| max_connections | 151   | 
-+-----------------+-------+ 
-1 row in set (0.00 sec) 
- 
-MariaDB [mysql]>  
-</code> 
- 
-Notez la valeur et ensuite définissez-la à 1 pour n'avoir que la connexion de root : 
- 
-<code> 
-MariaDB [mysql]> SET GLOBAL max_connections = 1; 
-Query OK, 0 rows affected 
- 
-MariaDB [mysql]> SHOW VARIABLES LIKE 'max_connections'; 
-+-----------------+-------+ 
-| Variable_name   | Value | 
-+-----------------+-------+ 
-| max_connections | 1     | 
-+-----------------+-------+ 
-1 row in set (0.00 sec) 
- 
-MariaDB [mysql]>  
-</code> 
- 
-Pour sauvegarder la totalité des bases de données sur le maître, il convient d'utiliser la commande suivante : 
- 
-  # mysqldump --user=root --password=fenestros1 --extended-insert --all-databases --master-data --event  > /tmp/backup.sql [Entrée] 
- 
-<WRAP center round important 60%> 
-**Important** - Notez que **--master-data** permet à mysqldump de récupérer les données du maître concernant la réplication. 
-</WRAP> 
- 
-Ensuite sur l'esclave, il convient d'injecter le fichier backup.sql en provenance du maître: 
- 
-  # mysql --user=root --password=fenestros < /tmp/backup.sql [Entrée] 
- 
-Dernièrement, re-définissez à 151 connexions la valeur de **max-connexions** sur le maître et ensuite contrôlez la valeur de **max_connections**: 
- 
-<code> 
-MariaDB [mysql]> SET GLOBAL max_connections = 151; 
-Query OK, 0 rows affected (0.01 sec) 
- 
-MariaDB [mysql]> SHOW VARIABLES LIKE 'max_connections'; 
-+-----------------+-------+ 
-| Variable_name   | Value | 
-+-----------------+-------+ 
-| max_connections | 151   | 
-+-----------------+-------+ 
-1 row in set (0.37 sec) 
- 
-MariaDB [mysql]>  
-</code> 
  
 ----- -----
Menu