mysql_basic_os_related 2020-01-07 Linux Linux, MySQL, Official doc Comments MySQL-related OS Command1234567891011121314151617181920212223242526gunzip -c a.tar.gz | tar -xvf -gunzip < a.tar.gz | tar -xvf -zcat a.tar.gz | tar -xvf -tar -zxvf a.tar.gz# md5 check md5sum package_name;openssl md5 package_name;gpg --import mysql_pubky.ascgpg --recv-keys 5072E1F5gpg --verify package_name.ascrpm --import mysql_pubkey.ascyum install mysql-community-{server,client,common,libs}-*yum-config-manager --disable mariadbyum --disablerepo=\* --enablerepo='mysql*-community*' list availableyum --disablerepo=epel list installed mysql\*yumdownloader --disablerepo=epel yum-utilsyum-config-manager --disable mariadbrpm -qpl package_name.rpmdpkg-preconfigure mysql-community-server_*.debdpkg -i mysql-{common,community-client,client,community-server,server}_*.debapt-get -f installcat /etc/my.cnf123456789101112131415161718192021222324[root@master ~]# cat /etc/my.cnf[mysqld@01]port=3306datadir=/var/lib/mysqld01socket=/var/lib/mysqld01/mysqld01.socksymbolic-links=0log-error=/var/log/mysqld01.logpid-file=/var/run/mysqld01/mysqld01.pid[mysqld@02]port=3307datadir=/var/lib/mysqld02socket=/var/lib/mysqld02/mysqld02.socksymbolic-links=0log-error=/var/log/mysqld02.logpid-file=/var/run/mysqld02/mysqld02.pid[mysqld@03]port=3308datadir=/var/lib/mysqld03socket=/var/lib/mysqld03/mysqld03.socksymbolic-links=0log-error=/var/log/mysqld03.logpid-file=/var/run/mysqld03/mysqld03.pid12345678910111213141516systemctl daemon-reloadsystemctl start mysqld@01systemctl start mysqld@02systemctl start mysqld@03[root@master ~]# netstat -antActive Internet connections (servers and established)Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp 0 52 192.168.1.4:22 192.168.1.1:13648 ESTABLISHEDtcp6 0 0 :::3306 :::* LISTEN tcp6 0 0 :::3307 :::* LISTEN tcp6 0 0 :::3308 :::* LISTEN tcp6 0 0 :::22 :::* LISTEN [root@master ~]#