Annexes:MariaDB : Différence entre versions
(→Installation par yum) |
|||
Ligne 1 : | Ligne 1 : | ||
==Installation par yum== | ==Installation par yum== | ||
Activation des repo et installation par yum.<br> | Activation des repo et installation par yum.<br> | ||
− | Exemple pour l’installation d’une MariaDB 10.5 sur CentOS 7 : | + | Exemple pour l’installation d’une MariaDB 10.5 sur CentOS 7.<br> |
+ | <br> | ||
+ | Activation du repo officiel MariaDB : | ||
<pre> | <pre> | ||
#Activate official repo | #Activate official repo | ||
Ligne 18 : | Ligne 20 : | ||
... | ... | ||
... | ... | ||
+ | </pre> | ||
+ | <br> | ||
+ | Installation par le repo : | ||
+ | <pre> | ||
+ | yum install -y MariaDB-server MariaDB-client MariaDB-common MariaDB-compat MariaDB-shared MariaDB-backup | ||
</pre> | </pre> | ||
<br> | <br> |
Version du 19 décembre 2020 à 18:26
Installation par yum
Activation des repo et installation par yum.
Exemple pour l’installation d’une MariaDB 10.5 sur CentOS 7.
Activation du repo officiel MariaDB :
#Activate official repo yum install -y wget wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup chmod +x mariadb_repo_setup ./mariadb_repo_setup [root@vmsqwarebox ~]# cat /etc/yum.repos.d/mariadb.repo [mariadb-main] name = MariaDB Server baseurl = https://downloads.mariadb.com/MariaDB/mariadb-10.5/yum/rhel/$releasever/$basearch gpgkey = file:///etc/pki/rpm-gpg/MariaDB-Server-GPG-KEY gpgcheck = 1 enabled = 1 ... ...
Installation par le repo :
yum install -y MariaDB-server MariaDB-client MariaDB-common MariaDB-compat MariaDB-shared MariaDB-backup
Modifications post-installation
Mise en démarrage automatique :
[root@vmsqwarebox tmp]# chkconfig mysql on [root@vmsqwarebox tmp]# service mysql start
Changement du mot de passe du user MySQL ‘root’ :
[root@vmsqwarebox tmp]# /usr/bin/mysql_secure_installation
Test de connexion:
[root@vmsqwarebox tmp]# mysql -S /var/lib/mysql/mysql.sock -uroot -pSqwareMys Warning: Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 11 Server version: 5.6.27 MySQL Community Server (GPL) Copyright (c) 2000, 2015, 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 databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | +--------------------+ 3 rows in set (0.00 sec) mysql> Bye Remise du user unix ‘mysql’ dans le groupe dba : <pre> [root@vmsqwarebox tmp]# id mysql uid=503(mysql) gid=157(mysql) groupes=157(mysql) [root@vmsqwarebox tmp]# usermod -Gdba,mysql mysql [root@vmsqwarebox tmp]# id mysql uid=503(mysql) gid=157(mysql) groupes=157(mysql),500(dba)
Quelques paramètres conseillés :
[root@vmsqwarebox tmp]# cat /etc/my.cnf [mysqld] skip-name-resolve read_buffer_size = 3M key_buffer_size = 128M max_allowed_packet = 16M thread_stack = 192K thread_cache_size = 32 myisam_recover_options = BACKUP max_connections = 100 table_definition_cache = 400 sort_buffer_size = 32M myisam_sort_buffer_size = 64M innodb_buffer_pool_size = 1024M join_buffer_size = 64M tmp_table_size = 16M innodb_thread_concurrency = 16 innodb_file_per_table = 1
Patch de RPM
Téléchargez les RPM client, devel, shared, shared-compat et server pour votre OS et mettez-les dans /tmp.
Exemple pour patcher d’une 5.6.27 à une 5.6.43 :
[root@vmsqwarebox home]# cd /tmp ## Stop instance /etc/init.d/mysql stop [root@vmsqwarebox ~]# rpm -Uvh MySQL-client-5.6.43-1.el6.x86_64.rpm MySQL-shared-5.6.43-1.el6.x86_64.rpm MySQL-devel-5.6.43-1.el6.x86_64.rpm MySQL-server-5.6.43-1.el6.x86_64.rpm MySQL-shared-compat-5.6.43-1.el6.x86_64.rpm warning: MySQL-client-5.6.43-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ########################################### [100%] 1:MySQL-shared-compat ########################################### [ 20%] Giving mysqld 5 seconds to exit nicely 2:MySQL-server ########################################### [ 40%] 3:MySQL-devel ########################################### [ 60%] 4:MySQL-shared ########################################### [ 80%] 5:MySQL-client ########################################### [100%] ## Start instance /etc/init.d/mysql start