Datalbi  
Créé le 15/09/2015 par Laurent Bourcier

Installation de MySQL 5.6 Community Edition sous CentOS 7

Sommaire
1. Introduction
2. Prérequis système
3. Installation du logiciel MySQL 5.6 Community Server
4. Actions post installation
5. Liste des fichiers installés
6. Liste des dépendances RPM

1. Introduction

La méthode conseillée pour l'installation sous CentOS est d'utiliser les paquetages rpm fournis sur le site MySQL.

Le téléchargement des fichiers se fait à l'URL : http://dev.mysql.com/downloads

Il faut sélectionner la plateforme "Red Hat Enterprise Linux" et choisir de télécharger "Red Hat Enterprise Linux (x86 64bit) RPM Bundle".

On obtient un fichier tar de 229 Mo.

Les fichiers contenus dans ce tar sont :

Seuls les paquetages "MySQL server" et "MySQL client" sont indispensables.

2. Prérequis système

Les paquetages requis sont :

perl-5.16.3-285.el7.x86_64
perl-Data-Dumper-2.145-3.el7.x86_64
chkconfig-1.3.61-4.el7.x86_64
coreutils-8.22-11.el7.x86_64
grep-2.20-1.el7.x86_64
libaio-0.3.109-12.el7.x86_64
glibc-2.17-78.el7.x86_64
libgcc-4.8.3-9.el7.x86_64
libstdc++-4.8.3-9.el7.x86_64
net-tools-2.0-0.17.20131004git.el7.x86_64
procps-ng-3.3.10-3.el7.x86_64
shadow-utils-4.1.5.1-18.el7.x86_64

D'autre part, des librairies mariadb peuvent être en conflit avec l'installation. Comme ces libriaries sont utilisées par postfix, on est obligé de les supprimer avec l'option "--nodeps".

L'installation des paquetages se résumé aux opérations suivantes :

yum install net-tools
yum install perl
yum install perl-Data-Dumper

rpm -e --nodeps mariadb-libs-5.5.41-2.el7_0.x86_64

La résolution IP / hostname doit être opérationnelle. La commande suivante :

resolveip `hostname`
doit pouvoir s'exécuter sans erreur.

Dans le cas où une erreur apparait, on peut forcer la résolution en incluant l'ip dans /etc/hosts.

Il ne doit pas y avoir de blocage du port 3306 par un éventuel firewall. On peut donc désactiver le firewall :

# systemctl disable firewalld
# systemctl stop firewalld

3. Installation du logiciel MySQL 5.6 Community Server

Il convient d'installer au moins deux RPM :

La paquetage MySQL client fournit le binaire "mysql" indispensable pour une administration courante du serveur. Ce binaire n'est pas inclus dans le paquetage MySQL Server.

# cd /root/distrib_mysql
# tar xf ../MySQL-5.6.26-1.el7.x86_64.rpm-bundle.tar
# ls -l
total 234820
-rw-r--r--. 1 7155 wheel 20002848 15 juil. 19:16 MySQL-client-5.6.26-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 wheel  3549168 15 juil. 19:16 MySQL-devel-5.6.26-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 wheel 92351788 15 juil. 19:16 MySQL-embedded-5.6.26-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 wheel 60689608 15 juil. 19:17 MySQL-server-5.6.26-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 wheel  2105724 15 juil. 19:18 MySQL-shared-5.6.26-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 wheel  2299656 15 juil. 19:18 MySQL-shared-compat-5.6.26-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 wheel 59441904 15 juil. 19:18 MySQL-test-5.6.26-1.el7.x86_64.rpm

# rpm -ivh MySQL-server-5.6.26-1.el7.x86_64.rpm
# rpm -ivh MySQL-client-5.6.26-1.el7.x86_64.rpm

4. Actions post installation

Initialiser les bases de données MySQL (compte root):

# mysql_install_db --user=mysql

Installing MySQL system tables...2015-09-15 14:44:39 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-09-15 14:44:39 0 [Note] /usr/sbin/mysqld (mysqld 5.6.26) starting as process 12743 ...
2015-09-15 14:44:39 12743 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-09-15 14:44:39 12743 [Note] InnoDB: The InnoDB memory heap is disabled
2015-09-15 14:44:39 12743 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-09-15 14:44:39 12743 [Note] InnoDB: Memory barrier is not used
2015-09-15 14:44:39 12743 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-09-15 14:44:39 12743 [Note] InnoDB: Using Linux native AIO
2015-09-15 14:44:39 12743 [Note] InnoDB: Not using CPU crc32 instructions
2015-09-15 14:44:39 12743 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-09-15 14:44:39 12743 [Note] InnoDB: Completed initialization of buffer pool
2015-09-15 14:44:39 12743 [Note] InnoDB: Highest supported file format is Barracuda.
2015-09-15 14:44:39 12743 [Note] InnoDB: 128 rollback segment(s) are active.
2015-09-15 14:44:39 12743 [Note] InnoDB: Waiting for purge to start
2015-09-15 14:44:39 12743 [Note] InnoDB: 5.6.26 started; log sequence number 1626027
2015-09-15 14:44:39 12743 [Note] Binlog end
2015-09-15 14:44:39 12743 [Note] InnoDB: FTS optimize thread exiting.
2015-09-15 14:44:39 12743 [Note] InnoDB: Starting shutdown...
2015-09-15 14:44:41 12743 [Note] InnoDB: Shutdown completed; log sequence number 1626037
OK

Filling help tables...2015-09-15 14:44:41 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-09-15 14:44:41 0 [Note] /usr/sbin/mysqld (mysqld 5.6.26) starting as process 12766 ...
2015-09-15 14:44:41 12766 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-09-15 14:44:41 12766 [Note] InnoDB: The InnoDB memory heap is disabled
2015-09-15 14:44:41 12766 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-09-15 14:44:41 12766 [Note] InnoDB: Memory barrier is not used
2015-09-15 14:44:41 12766 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-09-15 14:44:41 12766 [Note] InnoDB: Using Linux native AIO
2015-09-15 14:44:41 12766 [Note] InnoDB: Not using CPU crc32 instructions
2015-09-15 14:44:41 12766 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-09-15 14:44:41 12766 [Note] InnoDB: Completed initialization of buffer pool
2015-09-15 14:44:41 12766 [Note] InnoDB: Highest supported file format is Barracuda.
2015-09-15 14:44:41 12766 [Note] InnoDB: 128 rollback segment(s) are active.
2015-09-15 14:44:41 12766 [Note] InnoDB: Waiting for purge to start
2015-09-15 14:44:41 12766 [Note] InnoDB: 5.6.26 started; log sequence number 1626037
2015-09-15 14:44:41 12766 [Note] Binlog end
2015-09-15 14:44:41 12766 [Note] InnoDB: FTS optimize thread exiting.
2015-09-15 14:44:41 12766 [Note] InnoDB: Starting shutdown...
2015-09-15 14:44:43 12766 [Note] InnoDB: Shutdown completed; log sequence number 1626047
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  /usr/bin/mysqladmin -u root password 'new-password'
  /usr/bin/mysqladmin -u root -h vmmysql01.datalbi.com password 'new-password'

Alternatively you can run:

  /usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

  cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

  cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

Demmarrer l'instance MySQL :

# service mysql start
Starting MySQL. SUCCESS!

Créer un compte de connexion :

mysql -u root
mysql> create user 'dba'@'%' identified by 'dba';
mysql> grant all privileges on *.* to 'dba'@'%';
mysql> exit

5. Liste des fichiers installés

# rpm -ql MySQL-server-5.6.26-1.el7.x86_64

/etc/init.d/mysql
/etc/logrotate.d/mysql
/etc/my.cnf
/etc/my.cnf.d
/usr/bin/innochecksum
/usr/bin/my_print_defaults
/usr/bin/myisam_ftdump
/usr/bin/myisamchk
/usr/bin/myisamlog
/usr/bin/myisampack
/usr/bin/mysql_convert_table_format
/usr/bin/mysql_fix_extensions
/usr/bin/mysql_install_db
/usr/bin/mysql_plugin
/usr/bin/mysql_secure_installation
/usr/bin/mysql_setpermission
/usr/bin/mysql_tzinfo_to_sql
/usr/bin/mysql_upgrade
/usr/bin/mysql_zap
/usr/bin/mysqlbug
/usr/bin/mysqld_multi
/usr/bin/mysqld_safe
/usr/bin/mysqldumpslow
/usr/bin/mysqlhotcopy
/usr/bin/mysqltest
/usr/bin/perror
/usr/bin/replace
/usr/bin/resolve_stack_dump
/usr/bin/resolveip
/usr/lib64/mysql/plugin/adt_null.so
/usr/lib64/mysql/plugin/auth.so
/usr/lib64/mysql/plugin/auth_socket.so
/usr/lib64/mysql/plugin/auth_test_plugin.so
/usr/lib64/mysql/plugin/daemon_example.ini
/usr/lib64/mysql/plugin/debug/adt_null.so
/usr/lib64/mysql/plugin/debug/auth.so
/usr/lib64/mysql/plugin/debug/auth_socket.so
/usr/lib64/mysql/plugin/debug/auth_test_plugin.so
/usr/lib64/mysql/plugin/debug/innodb_engine.so
/usr/lib64/mysql/plugin/debug/libdaemon_example.so
/usr/lib64/mysql/plugin/debug/libmemcached.so
/usr/lib64/mysql/plugin/debug/mypluglib.so
/usr/lib64/mysql/plugin/debug/mysql_no_login.so
/usr/lib64/mysql/plugin/debug/qa_auth_client.so
/usr/lib64/mysql/plugin/debug/qa_auth_interface.so
/usr/lib64/mysql/plugin/debug/qa_auth_server.so
/usr/lib64/mysql/plugin/debug/semisync_master.so
/usr/lib64/mysql/plugin/debug/semisync_slave.so
/usr/lib64/mysql/plugin/debug/validate_password.so
/usr/lib64/mysql/plugin/innodb_engine.so
/usr/lib64/mysql/plugin/libdaemon_example.so
/usr/lib64/mysql/plugin/libmemcached.so
/usr/lib64/mysql/plugin/mypluglib.so
/usr/lib64/mysql/plugin/mysql_no_login.so
/usr/lib64/mysql/plugin/qa_auth_client.so
/usr/lib64/mysql/plugin/qa_auth_interface.so
/usr/lib64/mysql/plugin/qa_auth_server.so
/usr/lib64/mysql/plugin/semisync_master.so
/usr/lib64/mysql/plugin/semisync_slave.so
/usr/lib64/mysql/plugin/validate_password.so
/usr/sbin/mysqld
/usr/sbin/mysqld-debug
/usr/sbin/rcmysql
/usr/share/doc/MySQL-server-5.6.26
/usr/share/doc/MySQL-server-5.6.26/COPYING
/usr/share/doc/MySQL-server-5.6.26/ChangeLog
/usr/share/doc/MySQL-server-5.6.26/INFO_BIN
/usr/share/doc/MySQL-server-5.6.26/INFO_SRC
/usr/share/doc/MySQL-server-5.6.26/README
/usr/share/doc/MySQL-server-5.6.26/my-default.cnf
/usr/share/man/man1/innochecksum.1.gz
/usr/share/man/man1/my_print_defaults.1.gz
/usr/share/man/man1/myisam_ftdump.1.gz
/usr/share/man/man1/myisamchk.1.gz
/usr/share/man/man1/myisamlog.1.gz
/usr/share/man/man1/myisampack.1.gz
/usr/share/man/man1/mysql.server.1.gz
/usr/share/man/man1/mysql_convert_table_format.1.gz
/usr/share/man/man1/mysql_fix_extensions.1.gz
/usr/share/man/man1/mysql_install_db.1.gz
/usr/share/man/man1/mysql_plugin.1.gz
/usr/share/man/man1/mysql_secure_installation.1.gz
/usr/share/man/man1/mysql_setpermission.1.gz
/usr/share/man/man1/mysql_tzinfo_to_sql.1.gz
/usr/share/man/man1/mysql_upgrade.1.gz
/usr/share/man/man1/mysql_zap.1.gz
/usr/share/man/man1/mysqlbug.1.gz
/usr/share/man/man1/mysqld_multi.1.gz
/usr/share/man/man1/mysqld_safe.1.gz
/usr/share/man/man1/mysqldumpslow.1.gz
/usr/share/man/man1/mysqlhotcopy.1.gz
/usr/share/man/man1/mysqlman.1.gz
/usr/share/man/man1/mysqltest.1.gz
/usr/share/man/man1/perror.1.gz
/usr/share/man/man1/replace.1.gz
/usr/share/man/man1/resolve_stack_dump.1.gz
/usr/share/man/man1/resolveip.1.gz
/usr/share/man/man8/mysqld.8.gz
/usr/share/mysql
/usr/share/mysql/SELinux
/usr/share/mysql/SELinux/RHEL4
/usr/share/mysql/SELinux/RHEL4/mysql.fc
/usr/share/mysql/SELinux/RHEL4/mysql.te
/usr/share/mysql/binary-configure
/usr/share/mysql/bulgarian
/usr/share/mysql/bulgarian/errmsg.sys
/usr/share/mysql/charsets
/usr/share/mysql/charsets/Index.xml
/usr/share/mysql/charsets/README
/usr/share/mysql/charsets/armscii8.xml
/usr/share/mysql/charsets/ascii.xml
/usr/share/mysql/charsets/cp1250.xml
/usr/share/mysql/charsets/cp1251.xml
/usr/share/mysql/charsets/cp1256.xml
/usr/share/mysql/charsets/cp1257.xml
/usr/share/mysql/charsets/cp850.xml
/usr/share/mysql/charsets/cp852.xml
/usr/share/mysql/charsets/cp866.xml
/usr/share/mysql/charsets/dec8.xml
/usr/share/mysql/charsets/geostd8.xml
/usr/share/mysql/charsets/greek.xml
/usr/share/mysql/charsets/hebrew.xml
/usr/share/mysql/charsets/hp8.xml
/usr/share/mysql/charsets/keybcs2.xml
/usr/share/mysql/charsets/koi8r.xml
/usr/share/mysql/charsets/koi8u.xml
/usr/share/mysql/charsets/latin1.xml
/usr/share/mysql/charsets/latin2.xml
/usr/share/mysql/charsets/latin5.xml
/usr/share/mysql/charsets/latin7.xml
/usr/share/mysql/charsets/macce.xml
/usr/share/mysql/charsets/macroman.xml
/usr/share/mysql/charsets/swe7.xml
/usr/share/mysql/czech
/usr/share/mysql/czech/errmsg.sys
/usr/share/mysql/danish
/usr/share/mysql/danish/errmsg.sys
/usr/share/mysql/dictionary.txt
/usr/share/mysql/dutch
/usr/share/mysql/dutch/errmsg.sys
/usr/share/mysql/english
/usr/share/mysql/english/errmsg.sys
/usr/share/mysql/errmsg-utf8.txt
/usr/share/mysql/estonian
/usr/share/mysql/estonian/errmsg.sys
/usr/share/mysql/fill_help_tables.sql
/usr/share/mysql/french
/usr/share/mysql/french/errmsg.sys
/usr/share/mysql/german
/usr/share/mysql/german/errmsg.sys
/usr/share/mysql/greek
/usr/share/mysql/greek/errmsg.sys
/usr/share/mysql/hungarian
/usr/share/mysql/hungarian/errmsg.sys
/usr/share/mysql/innodb_memcached_config.sql
/usr/share/mysql/italian
/usr/share/mysql/italian/errmsg.sys
/usr/share/mysql/japanese
/usr/share/mysql/japanese/errmsg.sys
/usr/share/mysql/korean
/usr/share/mysql/korean/errmsg.sys
/usr/share/mysql/magic
/usr/share/mysql/my-default.cnf
/usr/share/mysql/mysql-log-rotate
/usr/share/mysql/mysql.server
/usr/share/mysql/mysql_security_commands.sql
/usr/share/mysql/mysql_system_tables.sql
/usr/share/mysql/mysql_system_tables_data.sql
/usr/share/mysql/mysql_test_data_timezone.sql
/usr/share/mysql/mysqld_multi.server
/usr/share/mysql/norwegian
/usr/share/mysql/norwegian-ny
/usr/share/mysql/norwegian-ny/errmsg.sys
/usr/share/mysql/norwegian/errmsg.sys
/usr/share/mysql/polish
/usr/share/mysql/polish/errmsg.sys
/usr/share/mysql/portuguese
/usr/share/mysql/portuguese/errmsg.sys
/usr/share/mysql/romanian
/usr/share/mysql/romanian/errmsg.sys
/usr/share/mysql/russian
/usr/share/mysql/russian/errmsg.sys
/usr/share/mysql/serbian
/usr/share/mysql/serbian/errmsg.sys
/usr/share/mysql/slovak
/usr/share/mysql/slovak/errmsg.sys
/usr/share/mysql/spanish
/usr/share/mysql/spanish/errmsg.sys
/usr/share/mysql/swedish
/usr/share/mysql/swedish/errmsg.sys
/usr/share/mysql/ukrainian
/usr/share/mysql/ukrainian/errmsg.sys
/var/lib/mysql


# rpm -ql MySQL-client-5.6.26-1.el7.x86_64

/usr/bin/msql2mysql
/usr/bin/mysql
/usr/bin/mysql_config_editor
/usr/bin/mysql_find_rows
/usr/bin/mysql_waitpid
/usr/bin/mysqlaccess
/usr/bin/mysqlaccess.conf
/usr/bin/mysqladmin
/usr/bin/mysqlbinlog
/usr/bin/mysqlcheck
/usr/bin/mysqldump
/usr/bin/mysqlimport
/usr/bin/mysqlshow
/usr/bin/mysqlslap
/usr/share/doc/MySQL-client-5.6.26
/usr/share/doc/MySQL-client-5.6.26/COPYING
/usr/share/doc/MySQL-client-5.6.26/README
/usr/share/man/man1/msql2mysql.1.gz
/usr/share/man/man1/mysql.1.gz
/usr/share/man/man1/mysql_config_editor.1.gz
/usr/share/man/man1/mysql_find_rows.1.gz
/usr/share/man/man1/mysql_waitpid.1.gz
/usr/share/man/man1/mysqlaccess.1.gz
/usr/share/man/man1/mysqladmin.1.gz
/usr/share/man/man1/mysqlbinlog.1.gz
/usr/share/man/man1/mysqlcheck.1.gz
/usr/share/man/man1/mysqldump.1.gz
/usr/share/man/man1/mysqlimport.1.gz
/usr/share/man/man1/mysqlshow.1.gz
/usr/share/man/man1/mysqlslap.1.gz

6. Liste des dépendances RPM

# rpm -qR MySQL-server-5.6.26-1.el7.x86_64
/bin/sh
/bin/sh
/bin/sh
/bin/sh
/bin/sh
/usr/bin/perl
chkconfig
config(MySQL-server) = 5.6.26-1.el7
coreutils
grep
libaio.so.1()(64bit)
libaio.so.1(LIBAIO_0.1)(64bit)
libaio.so.1(LIBAIO_0.4)(64bit)
libc.so.6()(64bit)
libc.so.6(GLIBC_2.10)(64bit)
libc.so.6(GLIBC_2.14)(64bit)
libc.so.6(GLIBC_2.15)(64bit)
libc.so.6(GLIBC_2.16)(64bit)
libc.so.6(GLIBC_2.17)(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.3)(64bit)
libc.so.6(GLIBC_2.3.4)(64bit)
libc.so.6(GLIBC_2.4)(64bit)
libc.so.6(GLIBC_2.7)(64bit)
libc.so.6(GLIBC_2.8)(64bit)
libcrypt.so.1()(64bit)
libcrypt.so.1(GLIBC_2.2.5)(64bit)
libdl.so.2()(64bit)
libdl.so.2(GLIBC_2.2.5)(64bit)
libgcc_s.so.1()(64bit)
libgcc_s.so.1(GCC_3.0)(64bit)
libgcc_s.so.1(GCC_3.3.1)(64bit)
libm.so.6()(64bit)
libm.so.6(GLIBC_2.2.5)(64bit)
libpthread.so.0()(64bit)
libpthread.so.0(GLIBC_2.2.5)(64bit)
libpthread.so.0(GLIBC_2.3.2)(64bit)
libstdc++.so.6()(64bit)
libstdc++.so.6(CXXABI_1.3)(64bit)
libstdc++.so.6(GLIBCXX_3.4)(64bit)
libstdc++.so.6(GLIBCXX_3.4.11)(64bit)
libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
libstdc++.so.6(GLIBCXX_3.4.9)(64bit)
net-tools
procps
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rtld(GNU_HASH)
shadow-utils
rpmlib(PayloadIsXz) <= 5.2-1


# rpm -qR MySQL-client-5.6.26-1.el7.x86_64
/bin/sh
/usr/bin/perl
libc.so.6()(64bit)
libc.so.6(GLIBC_2.11)(64bit)
libc.so.6(GLIBC_2.14)(64bit)
libc.so.6(GLIBC_2.17)(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.3)(64bit)
libc.so.6(GLIBC_2.3.4)(64bit)
libc.so.6(GLIBC_2.4)(64bit)
libdl.so.2()(64bit)
libdl.so.2(GLIBC_2.2.5)(64bit)
libgcc_s.so.1()(64bit)
libgcc_s.so.1(GCC_3.0)(64bit)
libm.so.6()(64bit)
libm.so.6(GLIBC_2.2.5)(64bit)
libncurses.so.5()(64bit)
libpthread.so.0()(64bit)
libpthread.so.0(GLIBC_2.2.5)(64bit)
libpthread.so.0(GLIBC_2.3.2)(64bit)
libstdc++.so.6()(64bit)
libstdc++.so.6(CXXABI_1.3)(64bit)
libstdc++.so.6(GLIBCXX_3.4)(64bit)
libtinfo.so.5()(64bit)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rtld(GNU_HASH)
rpmlib(PayloadIsXz) <= 5.2-1