一看必會系列:mariadb 單一版本多實例 安裝配置

來源:本站原創 mysql_mariadb 超過357 views圍觀 0條評論

 

進入官網源配置工具選擇指定的源 5.5

https://downloads.mariadb.org/mariadb/repositories/#mirror=shanghai-university&distro=CentOS&distro_release=centos7-amd64–centos7&version=5.5

———配置源
vim /etc/yum.repos.d/mariadb5.5.repo
Here is your custom MariaDB YUM repository entry for CentOS. Copy and paste it into a file under /etc/yum.repos.d/ (we suggest naming the file MariaDB.repo or something similar).

# MariaDB 5.5 CentOS repository list – created 2018-06-12 01:26 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
After the file is in place, install MariaDB with:

yum makecache

———–yum指定安裝
yum list |grep mariadb

mariadb.x86_64                           1:5.5.56-2.el7                base       
mariadb-server.x86_64                    1:5.5.56-2.el7                base    

yum install -y mariadb*

[[email protected] ~]# rpm -qa |grep maria
mariadb-libs-5.5.56-2.el7.x86_64
mariadb-embedded-5.5.56-2.el7.x86_64
mariadb-bench-5.5.56-2.el7.x86_64
mariadb-5.5.56-2.el7.x86_64
mariadb-devel-5.5.56-2.el7.x86_64
mariadb-embedded-devel-5.5.56-2.el7.x86_64
mariadb-server-5.5.56-2.el7.x86_64
mariadb-test-5.5.56-2.el7.x86_64

systemctl enable mariadb
systemctl restart mariadb

 
———–多實例配置開始——————–

添加MySQL用戶
groupadd mysql
useradd -g mysql -s /sbin/nologin mysql

建例mysqldata目錄
mkdir -p /Data/mysqldata/33{07,08,09,10}
chown -R mysql:mysql /usr/mysqldata*
mkdir -p /var/log/mysql

另一種方式
mkdir -p /Data/mysqldata/
cd  /Data/mysqldata/
[[email protected] mysqldata]# mkdir -p 33{12..24}
[[email protected] mysqldata]# ll
total 8
drwxr-xr-x 5 mysql mysql  254 Oct 25 13:51 3307
drwxr-xr-x 5 mysql mysql  278 Jul  3 15:58 3312
drwxr-xr-x 5 mysql mysql 4096 Jul  5 14:24 3312
drwxr-xr-x 6 mysql mysql 4096 Jul  5 13:57 3310
drwxr-xr-x 2 root  root     6 Oct 25 14:00 3321
drwxr-xr-x 2 root  root     6 Oct 25 14:01 3322
drwxr-xr-x 2 root  root     6 Oct 25 14:01 3323
drwxr-xr-x 2 root  root     6 Oct 25 14:00 3324

初始化數據文件
mysql_install_db –datadir=/Data/mysqldata/3312/ –user=mysql
chown -R mysql:mysql /Data/mysqldata/*
如有報錯不掉他

ll /Data/mysqldata/3312/

[[email protected] mysql]# ll /Data/mysqldata/3312
total 29788
-rw-rw—-. 1 mysql mysql    16384 Jun 29 11:15 aria_log.00000001
-rw-rw—-. 1 mysql mysql       52 Jun 29 11:15 aria_log_control
-rw-rw—-. 1 mysql mysql 18874368 Jun 29 11:17 ibdata1
-rw-rw—-. 1 mysql mysql  5242880 Jun 29 11:17 ib_logfile0
-rw-rw—-. 1 mysql mysql  5242880 Jun 29 11:17 ib_logfile1
drwx——. 2 mysql mysql     4096 Jun 29 11:15 mysql
-rw-rw—-. 1 mysql mysql    30797 Jun 29 11:15 mysql-bin.000001
-rw-rw—-. 1 mysql mysql  1069459 Jun 29 11:15 mysql-bin.000002
-rw-rw—-. 1 mysql mysql      467 Jun 29 11:24 mysql-bin.000003
-rw-rw—-. 1 mysql mysql       57 Jun 29 11:17 mysql-bin.index
drwx——. 2 mysql mysql     4096 Jun 29 11:15 performance_schema
drwx——. 2 mysql mysql        6 Jun 29 11:15 test
[[email protected] mysql]#

修改配置文件開始多實例—這一步一定要
vim /etc/my.cnf

#添加引導模塊
[mysqld_multi]
mysqld     = /usr/bin/mysqld_safe
#指定程序目錄啟動文件(mysqld_safe安全模式的啟動方式)
mysqladmin = /usr/bin/mysqladmin
#指定管理程序所在的目錄
user       = mysql
password   = mysql
#指定是那一個用戶(必須是系統是存在的用戶)

新建配置文件

mkdir /etc/mysql
chown -R mysql:mysql /etc/mysql

[[email protected] mysql]# ll
total 12
-rw-r–r–. 1 mysql mysql 654 Jun 27 17:01 cfg_1.cnf
-rw-r–r–. 1 mysql mysql 654 Jun 27 17:00 mysql3312.cnf
-rw-r–r–. 1 root  root  654 Jun 29 11:17 cfg_3.cnf
[[email protected] mysql]# pwd
/etc/mysql

vim替換命令
:%s/3312/3310

vim /etc/mysql/mysql3312.cnf

配置與原配置相似
[mysqld3312]
port=3312
#占用的端口(每一個實例一個端口)
socket=/tmp/mysql3312.sock
##指定套接字文件所在的目錄
pid-file=/tmp/mysql3312.pid
##指定鎖文件所在位置
#max_allowed_packet=1M
#net_buffer_length=2k
##包消息緩沖區初始化為net_buffer_length字節,但需要時可以增長到max_allowed_packet字節
#table_open_cache=4
##所有線程打開的表的個數
#sort_buffer_size=64k
##排序buffer大小;線程級別
#thread_stack=128k
##每個線程的堆棧大小
#basedir=/usr/local/mysql
##源文件所在的目錄
datadir=/Data/mysqldata/3312
##數據實例目錄
server-id=1
##指定為主服務器

—————-推薦啟停方式————————————–
以服務的方式啟動、停止,需修改配置文件
/usr/bin/mysqld_multi –defaults-extra-file=/etc/mysql/mysql3312.cnf –log=/var/log/mysql_3312.log start

啟動后進行授權
mysql -S /tmp/mysql3312.sock  本地登陸
grant shutdown on *.* to  [email protected] identified by ‘mysql’;
flush privileges;

停止命令
/usr/bin/mysqld_multi –defaults-extra-file=/etc/mysql/mysql3312.cnf –log=/var/log/mysql_3312.log stop

————-多實例配置完成———————–

[[email protected] mysql]# !net
netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name   
tcp        0      0 0.0.0.0:3312            0.0.0.0:*               LISTEN      14804/mysqld       
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1875/sshd          
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2042/master        
tcp6       0      0 :::22                   :::*                    LISTEN      1875/sshd          
tcp6       0      0 ::1:25

##############以下為加分內容#############################

——————用以上命令出現無法停機故障 查看日志發現權限不夠
[[email protected] ~]# tail -f /var/log/mysql_3312.log
Stopping MySQL servers

/usr/bin/mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘mysql’@’localhost’ (using password: YES)’
mysqld_multi log file version 2.16; run: Sat Sep 23 14:26:04 2017

Stopping MySQL servers

/usr/bin/mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘mysql’@’localhost’ (using password: YES)’

解決方案:
增加mysql權限
mysql -S /tmp/mysql3312.sock  本地登陸
grant shutdown on *.* to  [email protected] identified by ‘mysql’;
flush privileges;

驗證:
mysqld_multi log file version 2.16; run: Sat Sep 23 14:26:38 2017

Stopping MySQL servers

/usr/bin/mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘mysql’@’localhost’ (using password: YES)’
mysqld_multi log file version 2.16; run: Sat Sep 23 14:28:44 2017

Stopping MySQL servers   —停止正常

 

—————服務形式啟動———————————–
完整文件
vim /etc/systemd/system/[email protected]

[Unit]
Description=MySQL Multi Server for instance %i
After=syslog.target
After=network.target

[Service]
User=mysql
Group=mysql
Type=forking
#ExecStart=/usr/bin/mysqld_multi –defaults-file=/etc/mysql/cfg_%i.cnf –log=/var/log/mysql_multi.log start %i
#ExecStop=/usr/bin/mysqld_multi –log=/var/log/mysql_multi.log stop %i
ExecStart=/usr/bin/mysqld_multi –defaults-extra-file=/etc/mysql/cfg_%i.cnf –log=/var/log/mysql_multi.log start
ExecStop=/usr/bin/mysqld_multi –defaults-extra-file=/etc/mysql/cfg_%i.cnf –log=/var/log/mysql_multi.log stop
Restart=always
RestartSec=5
PrivateTmp=true

[Install]
WantedBy=multi-user.target

 

啟動測試
systemctl start [email protected]
Warning: [email protected] changed on disk. Run ‘systemctl daemon-reload’ to reload units

需先運行 systemctl daemon-reload

netstat -ntl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State     
tcp        0      0 0.0.0.0:3307            0.0.0.0:*               LISTEN    
tcp        0      0 0.0.0.0:3312            0.0.0.0:*               LISTEN   —已啟動 
tcp        0      0 0.0.0.0:3312            0.0.0.0:*               LISTEN    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN    
tcp6       0      0 :::80                   :::*                    LISTEN    
tcp6       0      0 :::22

狀態
[[email protected] mysql]# systemctl status [email protected]
[email protected] – MySQL Multi Server for instance 2
   Loaded: loaded (/etc/systemd/system/[email protected]; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2017-06-29 17:43:35 CST; 29s ago
  Process: 87923 ExecStop=/usr/bin/mysqld_multi –defaults-extra-file=/etc/mysql/cfg_%i.cnf –log=/var/log/mysql_multi.log stop (code=exited, status=0/SUCCESS)
  Process: 87936 ExecStart=/usr/bin/mysqld_multi –defaults-extra-file=/etc/mysql/cfg_%i.cnf –log=/var/log/mysql_multi.log start (code=exited, status=0/SUCCESS)
Main PID: 87942 (mysqld_safe)
   CGroup: /system.slice/system-mysqld.slice/[email protected]
           ├─87942 /bin/sh /usr/bin/mysqld_safe –port=3312 –socket=/tmp/mysql3312.sock –pid-file=/tmp/mysql3312.pid –datadir=/usr/mys…
           └─88218 /usr/libexec/mysqld –basedir=/usr –datadir=/Data/mysqldata3312 –plugin-dir=/usr/lib64/mysql/plugin –server-id=1 –…

Jun 29 17:43:35 mysql01 systemd[1]: Starting MySQL Multi Server for instance 2…
Jun 29 17:43:35 mysql01 systemd[1]: Started MySQL Multi Server for instance 2.

停機測試

[[email protected] mysql]# systemctl stop [email protected]
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State     
tcp        0      0 0.0.0.0:3307            0.0.0.0:*               LISTEN    
tcp        0      0 0.0.0.0:3312            0.0.0.0:*               LISTEN    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN    
tcp6       0      0 :::80                   :::*                    LISTEN    
tcp6       0      0 :::22                   :::*                    LISTEN    
[[email protected] mysql]# systemctl status [email protected]
[email protected] – MySQL Multi Server for instance 2
   Loaded: loaded (/etc/systemd/system/[email protected]; disabled; vendor preset: disabled)
   Active: inactive (dead)

Jun 29 17:42:43 mysql01 systemd[1]: Starting MySQL Multi Server for instance 2…
Jun 29 17:42:43 mysql01 systemd[1]: Started MySQL Multi Server for instance 2.
Jun 29 17:42:48 mysql01 systemd[1]: [email protected] holdoff time over, scheduling restart.
Jun 29 17:42:48 mysql01 systemd[1]: Starting MySQL Multi Server for instance 2…
Jun 29 17:42:49 mysql01 systemd[1]: Started MySQL Multi Server for instance 2.
Jun 29 17:43:34 mysql01 systemd[1]: Stopping MySQL Multi Server for instance 2…
Jun 29 17:43:35 mysql01 systemd[1]: Starting MySQL Multi Server for instance 2…
Jun 29 17:43:35 mysql01 systemd[1]: Started MySQL Multi Server for instance 2.
Jun 29 17:45:30 mysql01 systemd[1]: Stopping MySQL Multi Server for instance 2…
Jun 29 17:45:31 mysql01 systemd[1]: Stopped MySQL Multi Server for instance 2.
[[email protected] mysql]#

 

—————以下啟停方式不推薦—————————
mysql -uroot -p -S  /tmp/mysql3312.sock
停止一個實例
mysqld_multi –defaults-extra-file=/etc/mysql/cfg_3.cnf stop
正常來說你是停不掉的,因為權限不對。
這樣做的目地只有一個,是允許那一個用戶關閉此實例,如果不是此用戶對此實例關閉,那么此實例會自動重啟,
也就是說無法正常關閉(當此實例工作過程中意外中斷也會自動重啟的)
grant shutdown on *.* to  [email protected] identified by ‘#$h342jh’;
flush privileges;

如何本地管理
mysql -S /tmp/mysql3312.sock

——————————————————————————
上面的方式能啟能停但無法管理,且不生成 mysql.socket 和mysql.pid,
從最后的結果來看應該也是mysql這個帳戶的權限問題修正后即可。
加入權限后已可管理。
[[email protected] mysql]# mysql -S /tmp/mysql3310.sock
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1
Server version: 5.5.52-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]>

—————管理實例—————–
mysql -S /tmp/mysql3310.sock

上面的方式能啟能停但無法管理

[[email protected] mysql]# mysql -S /tmp/mysql3310.sock
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql3310.sock’ (2)
[[email protected] mysql]#

——————-有時會碰到無法管理——————-
[[email protected] ~]# mysql -S /tmp/mysql3307.sock
ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)
[[email protected] ~]#
提示ROOT無權限

所成mysql 提示密碼不對
[[email protected] ~]# mysql -umysql -p -S /tmp/mysql3307.sock
Enter password:
ERROR 1045 (28000): Access denied for user ‘mysql’@’localhost’ (using password: YES)
[[email protected] ~]#

原因是
[mysqld3307]
datadir=/Data/mysqldata3307   —-少了一這條,不配置默認會使用原mysql配置
修改后解決

當然出現這個問題
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.

解決方法和上面也是一樣的

 

————–新問題 配置完成后無法啟動—————-
[[email protected] 3322]# /usr/bin/mysqld_multi –defaults-extra-file=/etc/mysql/cfg3321.cnf –log=/var/log/mysql_3321.log start
[[email protected] 3322]#
netstat -ntlp   ——-無進程
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name   
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      982/sshd           
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2846/sendmail: acce
tcp        0      0 0.0.0.0:10050           0.0.0.0:*               LISTEN      1136/zabbix_agentd 
tcp6       0      0 :::22                   :::*                    LISTEN      982/sshd           
tcp6       0      0 :::10050                :::*                    LISTEN      1136/zabbix_agentd 
[[email protected] 3322]#

日志報錯
171025 19:06:27 mysqld_safe Logging to ‘/var/log/mysql.log’.
171025 19:06:27 mysqld_safe Starting mysqld daemon with databases from /Data/mysqldata3321
171025 19:06:30 mysqld_safe mysqld from pid file /tmp/mysql3321.pid ended

—————又有新問題 能啟動不能停服務—————-
[[email protected] mysql]# /usr/bin/mysqld_multi –defaults-extra-file=/etc/mysql/my07.cnf  stop
[[email protected] mysql]#
[[email protected] mysql]#
[[email protected] mysql]# !net
netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name   
tcp        0      0 127.0.0.1:199           0.0.0.0:*               LISTEN      983/snmpd          
tcp        0      0 0.0.0.0:3307            0.0.0.0:*               LISTEN      11852/mysqld       
tcp        0      0 0.0.0.0:3312            0.0.0.0:*               LISTEN      12344/mysqld       
tcp        0      0 0.0.0.0:3312            0.0.0.0:*               LISTEN      12814/mysqld       

解決方法,開啟日志大法
[[email protected] mysql]# /usr/bin/mysqld_multi –defaults-extra-file=/etc/mysql/my07.cnf  –log=/var/log/mysql_multi.log stop
查看相應日志
[[email protected] ~]# tail -f /var/log/mysql_multi.log
mysqld_multi log file version 2.16; run: Mon Jul  3 15:26:15 2017

Stopping MySQL servers

/usr/bin/mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘mysql’@’localhost’ (using password: YES)’

原因是mysql 沒有停止權限。

————————給啟停服務帳號授權————————
mysql -S /tmp/mysql3312.sock

use mysql;
grant shutdown on *.* to [email protected]’localhost’ identified by ‘mysql’;
flush privileges;

MariaDB [mysql]> use mysql;
Database changed
MariaDB [mysql]> grant shutdown on *.* to [email protected]’localhost’ identified by ‘mysql’;
Query OK, 0 rows affected (0.00 sec)

MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [mysql]>

現在有管理權限可以啟停

驗證  停止3307服務
[[email protected] mysql]# /usr/bin/mysqld_multi –defaults-extra-file=/etc/mysql/my07.cnf  –log=/var/log/mysql_multi.log stop
netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name           
tcp        0      0 0.0.0.0:3312            0.0.0.0:*               LISTEN      12344/mysqld       
tcp        0      0 0.0.0.0:3312            0.0.0.0:*               LISTEN      12814/mysqld       
tcp        0      0 0.0.0.0:3310            0.0.0.0:*               LISTEN      13285/mysqld       

[[email protected] ~]# tail -5 /var/log/mysql_multi.log
error: ‘Access denied for user ‘mysql’@’localhost’ (using password: YES)’
mysqld_multi log file version 2.16; run: Mon Jul  3 15:45:32 2017

Stopping MySQL servers  —–停止信息

[[email protected] ~]#

———————多實例配置完成———————–
配置兩臺Mysql主主同步 參考上面。

———————以下為不可管理的故障說明———————-

[[email protected] mysql]# ps aux |grep 3310
mysql     93783  0.0  0.1 113256  1584 ?        S    18:06   0:00 /bin/sh /usr/bin/mysqld_safe –port=3310 –socket=/tmp/mysql3310.sock –pid-file=/tmp/mysql3310.pid –datadir=/Data/mysqldata3310 –server-id=1
mysql     94059  0.0  8.3 771324 83384 ?        Sl   18:06   0:00 /usr/libexec/mysqld –basedir=/usr –datadir=/Data/mysqldata3310 –plugin-dir=/usr/lib64/mysql/plugin –server-id=1 –log-error=/var/log/mariadb/mariadb.log –pid-file=/tmp/mysql3310.pid –socket=/tmp/mysql3310.sock –port=3310
root      94541  0.0  0.0 112648   964 pts/0    R+   18:09   0:00 grep –color=auto 3310

但手動運行卻有
[[email protected] mysql]# /usr/bin/mysqld_multi –defaults-extra-file=/etc/mysql/cfg_4.cnf start
[[email protected] mysql]# ll /tmp/
total 12
-rw-rw—-. 1 mysql mysql  6 Jun 27 17:16 mysql3307.pid
srwxrwxrwx. 1 mysql mysql  0 Jun 27 17:16 mysql3307.sock
-rw-rw—-. 1 mysql mysql  6 Jun 29 11:17 mysql3312.pid
srwxrwxrwx. 1 mysql mysql  0 Jun 29 11:17 mysql3312.sock
-rw-rw—-. 1 mysql mysql  6 Jun 29 18:12 mysql3310.pid
srwxrwxrwx. 1 mysql mysql  0 Jun 29 18:12 mysql3310.sock

手動運行卻無法停止——最后證明是權限問題
[[email protected] mysql]# /usr/bin/mysqld_multi –defaults-extra-file=/etc/mysql/cfg_4.cnf stop
[[email protected] mysql]# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name   
tcp        0      0 0.0.0.0:3307            0.0.0.0:*               LISTEN      14292/mysqld       
tcp        0      0 0.0.0.0:3312            0.0.0.0:*               LISTEN      12001/mysqld       
tcp        0      0 0.0.0.0:3310            0.0.0.0:*               LISTEN      97448/mysqld       
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2209/sshd          
tcp6       0      0 :::80                   :::*                    LISTEN      875/httpd          
tcp6       0      0 :::22                   :::*                    LISTEN      2209/sshd          
[[email protected] mysql]#

使用mysqladmin shutdown 可以停止
[[email protected] mysql]# mysqladmin shutdown -S /tmp/mysql3310.sock
netstat -ntl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State     
tcp        0      0 0.0.0.0:3307            0.0.0.0:*               LISTEN    
tcp        0      0 0.0.0.0:3312            0.0.0.0:*               LISTEN    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN    
tcp6       0      0 :::80                   :::*                    LISTEN  

 

———————排查過程————————–
查日志,當然要先開啟

在配置文件增加配置
log=/var/log/mariadb/mariadb3310.log                                                                                                      
"cfg_4.cnf" 24L, 691C

查看對應日志文件    
170630 11:37:32        1 Connect    [email protected] as anonymous on
            1 Connect    Access denied for user ‘mysql’@’localhost’ (using password: YES)

查日志確認是權限問題
MariaDB [mysql]> grant shutdown on *.* to [email protected]’localhost’ identified by ‘mysql’;
MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

再試一下,看結果搞定
[[email protected] mysql]# /usr/bin/mysqld_multi –defaults-extra-file=/etc/mysql/cfg_4.cnf stop
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name   
tcp        0      0 0.0.0.0:3307            0.0.0.0:*               LISTEN      14292/mysqld       
tcp        0      0 0.0.0.0:3312            0.0.0.0:*               LISTEN      12001/mysqld       
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2209/sshd          
tcp6       0      0 :::80                   :::*                    LISTEN      875/httpd          
tcp6       0      0 :::22                   :::*                    LISTEN      2209/sshd          
[[email protected] mysql]#

結總一下命令
開啟
/usr/bin/mysqld_multi –defaults-extra-file=/etc/mysql/cfg_4.cnf start
停止
/usr/bin/mysqld_multi –defaults-extra-file=/etc/mysql/cfg_4.cnf stop
管理
mysql -S /tmp/mysql3310.sock

———-安裝完無法啟動

Redirecting to /bin/systemctl start  mariadb.service

解決方法

yum install -y mariadb*

—-以上好吧怎么試都沒有用,不管怎么指定都是
yum install mariadb-5.5.56-2.el7.x86_64

Dependencies Resolved

===========================================================================================================================
Package                        Arch                   Version                               Repository               Size
===========================================================================================================================
Installing:
MariaDB-client                 x86_64                 10.1.33-1.el7.centos                  mariadb                  39 M
Installing for dependencies:
MariaDB-common                 x86_64                 10.1.33-1.el7.centos                  mariadb                 123 k

Transaction Summary
===========================================================================================================================
Install  1 Package (+1 Dependent package)

Total size: 40 M
Total download size: 39 M
Installed size: 173 M
Is this ok [y/d/N]: n

—————以上問題確認

因為存在兩個mariadb的源,最簡單的方法直接刪除一個,mariadb5.5的配置不需動

文章出自:CCIE那點事 http://www.qdxgqk.live/ 版權所有。本站文章除注明出處外,皆為作者原創文章,可自由引用,但請注明來源。 禁止全文轉載。
本文鏈接:http://www.qdxgqk.live/?p=3779轉載請注明轉自CCIE那點事
如果喜歡:點此訂閱本站
  • 相關文章
  • 為您推薦
  • 各種觀點
?
暫時還木有人評論,坐等沙發!
發表評論

您必須 [ 登錄 ] 才能發表留言!

?
?
萌宠夺宝游戏