Tutorial-Reihe MySQL-Reihe: Grundlegende Konzepte der relationalen MySQL-Datenbank 1. Installieren Sie den MariaDB-Server mit dem Yum-Paketmanager1) Yum-Quelle konfigurieren (offizielle MariaDB-Quelle) [root@centos6 ~]# vim /etc/yum.repos.d/mariadb-10.2.repo [Mariadb] Name=MariaDB baseurl=http://yum.mariadb.org/10.2/centos6-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 2) Installation [root@centos6 ~]# yum -y installiere MariaDB-Server 3) Starten Sie den Dienst und testen Sie [root@centos6 ~]# Dienst MySQL starten [root@centos6 mysql]# mysql #Wenn die Verbindung erfolgreich ist, bedeutet das OK! 2. Installieren Sie den MariaDB-Server mit dem offiziellen Binärpaket1) Holen Sie sich das Binärpaket # wget http://sfo1.mirrors.digitalocean.com/mariadb//mariadb-10.2.15/bintar-linux-x86_64/mariadb-10.2.15-linux-x86_64.tar.gz 2) Gruppen und Benutzer erstellen [root@centos6 ~]# groupadd -r -g 27 mysql [root@centos6 ~]# useradd -r -u 27 -g 27 -m -d /data/mysqldb -s /sbin/nologin mysql 3) Entpacken Sie das Softwarepaket und ändern Sie die Berechtigungen [root@centos6 ~]# tar xf mariadb-10.2.15-linux-x86_64.tar.gz -C /usr/local/ [root@centos6 ~]# cd /usr/local/ [root@centos6 lokal]# ln -s mariadb-10.2.15-linux-x86_64/mysql [root@centos6 lokal]# chown -R root:root mysql/ [root@centos6 lokal]# setfacl -R -mu:mysql:rwx mysql/ 4) Umgebungsvariablen festlegen [root@centos6 lokal]# echo "export PATH=/usr/local/mysql/bin:\$PATH" >/etc/profile.d/mysql.sh [root@centos6 lokal]# ./etc/profile.d/mysql.sh 5) Initialisieren Sie die Datenbank [root@centos6 local]# cd /usr/local/mysql/ #Sie müssen dieses Verzeichnis aufrufen, um das Initialisierungsskript auszuführen [root@centos6 mysql]# scripts/mysql_install_db --datadir=/data/mysqldb/ --user=mysql 6) Konfigurationsdateien bereitstellen [root@centos6 mysql]# cp support-files/my-huge.cnf /etc/my.cnf [root@centos6 mysql]# sed -i.bak '/\[mysqld\]/adatadir = /data/mysqldb' /etc/my.cnf 7) Bereitstellung eines Startdienstskripts [root@centos6 mysql]# cp support-files/mysql.server /etc/init.d/mysqld [root@centos6 mysql]# chkconfig --add mysqld [root@centos6 mysql]# chkconfig mysqld auf 8) Starten und testen [root@centos6 mysql]# Dienst mysqld starten [root@centos6 mysql]# mysql #Wenn die Verbindung erfolgreich ist, bedeutet das OK! 3. Kompilieren und installieren Sie den MariaDB-Server aus dem Quellcode1) Holen Sie sich den Quellcode # wget http://ftp.hosteurope.de/mirror/archive.mariadb.org//mariadb-10.2.15/source/mariadb-10.2.15.tar.gz 2) Bereiten Sie die Grundumgebung vor [root@centos6 ~]# yum -y installiere Bison Bison-Entwicklung zlib-Entwicklung libcurl-Entwicklung libarchive-Entwicklung boost-Entwicklung gcc gcc-c++ cmake libevent-Entwicklung gnutls-Entwicklung libaio-Entwicklung openssl-Entwicklung ncurses-Entwicklung libxml2-Entwicklung 3) Gruppen und Benutzer erstellen [root@centos6 ~]# groupadd -r -g 27 mysql [root@centos6 ~]# useradd -r -u 27 -g 27 -m -d /data/mysqldb -s /sbin/nologin mysql 4) Kompilieren und installieren [root@centos6 ~]# tar xf mariadb-10.2.15.tar.gz [root@centos6 ~]# cd mariadb-10.2.15 [root@centos6 mariadb-10.2.15]# cmake . \ -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DMYSQL_DATADIR=/Daten/mysqldb/ \ -DSYSCONFDIR=/usw \ -DMYSQL_USER=mysql \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_ARCHIVE_STORAGE_ENGINE=1 \ -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \ -DWITH_PARTITION_STORAGE_ENGINE=1 \ -DWITHOUT_MROONGA_STORAGE_ENGINE=1 \ -DWITH_DEBUG=0 \ -DWITH_READLINE=1 \ -DWITH_SSL=System \ -DWITH_ZLIB=System \ -DWITH_LIBWRAP=0 \ -DENABLED_LOCAL_INFILE=1 \ -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci [root@centos6 mariadb-10.2.15]# make -j4 && make install 5) Konfigurieren Sie Umgebungsvariablen und ändern Sie die Berechtigungen für das Softwareinstallationsverzeichnis [root@centos6 ~]# echo "export PATH=/usr/local/mysql/bin:\$PATH" >/etc/profile.d/mysql.sh [root@centos6 ~]# . /etc/profile.d/mysql.sh [root@centos6 ~]# setfacl -R -mu:mysql:rwx /usr/local/mysql/ 7) Initialisieren Sie die Datenbank, stellen Sie Konfigurationsdateien bereit und stellen Sie Dienststartskripte bereit [root@centos6 ~]# cd /usr/local/mysql/ [root@centos6 mysql]# scripts/mysql_install_db --datadir=/data/mysqldb/ --user=mysql --basedir=/usr/local/mysql/ [root@centos6 mysql]# cp support-files/my-huge.cnf /etc/my.cnf [root@centos6 mysql]# cp support-files/mysql.server /etc/init.d/mysqld [root@centos6 mysql]# chkconfig --add mysqld 8) Starten und testen [root@centos6 mysql]# Dienst mysqld starten [root@centos6 mysql]# mysql #Wenn die Verbindung erfolgreich ist, bedeutet das OK! Dies ist das Ende dieses Artikels über die Installation des MariaDB-Servers, einem der MySQL-Serien. Weitere Informationen zur Installation des MySQL MariaDB-Servers finden Sie in früheren Artikeln auf 123WORDPRESS.COM oder in den folgenden verwandten Artikeln. Ich hoffe, Sie werden 123WORDPRESS.COM auch in Zukunft unterstützen! Das könnte Sie auch interessieren:
|
>>: Frameset über Iframe in Body einfügen
Wie zentrieren Sie Ihre HTML-Schaltfläche selbst?...
Inhaltsverzeichnis MySQLs current_timestamp-Falle...
Mit der Multisite-Funktion von WordPress können S...
Inhaltsverzeichnis Vorwort Erster Blick auf React...
In diesem Artikel finden Sie das Tutorial zur Ins...
Dieser Artikel verwendet die Bereitstellung eines...
Inhaltsverzeichnis Welche Dienstprogramme bietet ...
Das img-Tag in XHTML sollte wie folgt geschrieben...
MJML ist ein modernes E-Mail-Tool, mit dem Entwic...
Ich habe MySQL vorher nicht sehr oft verwendet un...
Im Laufe der Arbeit werden Sie auf viele Fälle im...
Wenn Ihre Webanwendung nur auf einer Maschine läu...
Port 80 ist ebenfalls konfiguriert. Geben Sie zun...
Anruf Wie rufe ich die Amap-API auf? Das offiziel...
Wenn wir eine Tabelle verwenden, weisen wir ihr i...