@@ -84,7 +84,7 @@ func (opts *ConnectionOptions) TerminalTitle() string {
8484 opts .ProtocolType ,
8585 opts .systemUser .Username ,
8686 opts .asset .IP )
87- case srvconn .ProtocolMySQL :
87+ case srvconn .ProtocolMySQL , srvconn . ProtocolMariadb :
8888 title = fmt .Sprintf ("%s://%s@%s" ,
8989 opts .ProtocolType ,
9090 opts .systemUser .Username ,
@@ -103,7 +103,7 @@ func (opts *ConnectionOptions) ConnectMsg() string {
103103 case srvconn .ProtocolTELNET ,
104104 srvconn .ProtocolSSH :
105105 msg = fmt .Sprintf (i18n .T ("Connecting to %s@%s" ), opts .systemUser .Name , opts .asset .IP )
106- case srvconn .ProtocolMySQL :
106+ case srvconn .ProtocolMySQL , srvconn . ProtocolMariadb :
107107 msg = fmt .Sprintf (i18n .T ("Connecting to Database %s" ), opts .dbApp )
108108 case srvconn .ProtocolK8s :
109109 msg = fmt .Sprintf (i18n .T ("Connecting to Kubernetes %s" ), opts .k8sApp .Attrs .Cluster )
@@ -244,7 +244,7 @@ func NewServer(conn UserConnection, jmsService *service.JMService, opts ...Conne
244244 AssetID : connOpts .k8sApp .ID ,
245245 OrgID : connOpts .k8sApp .OrgID ,
246246 }
247- case srvconn .ProtocolMySQL :
247+ case srvconn .ProtocolMySQL , srvconn . ProtocolMariadb :
248248 if ! IsInstalledMysqlClient () {
249249 msg := i18n .T ("Database %s protocol client not installed." )
250250 msg = fmt .Sprintf (msg , connOpts .dbApp .TypeName )
@@ -417,7 +417,7 @@ func (s *Server) GenerateCommandItem(input, output string,
417417 DateCreated : createdDate .UTC (),
418418 }
419419
420- case srvconn .ProtocolMySQL :
420+ case srvconn .ProtocolMySQL , srvconn . ProtocolMariadb :
421421 return & model.Command {
422422 SessionID : s .ID ,
423423 OrgID : s .connOpts .dbApp .OrgID ,
@@ -492,7 +492,7 @@ func (s *Server) checkRequiredAuth() error {
492492 utils .IgnoreErrWriteString (s .UserConn , msg )
493493 return errors .New ("no auth token" )
494494 }
495- case srvconn .ProtocolMySQL , srvconn .ProtocolTELNET :
495+ case srvconn .ProtocolMySQL , srvconn .ProtocolMariadb , srvconn . ProtocolTELNET :
496496 if err := s .getUsernameIfNeed (); err != nil {
497497 msg := utils .WrapperWarn (i18n .T ("Get auth username failed" ))
498498 utils .IgnoreErrWriteString (s .UserConn , msg )
@@ -782,7 +782,7 @@ func (s *Server) getServerConn(proxyAddr *net.TCPAddr) (srvconn.ServerConnection
782782 return s .getTelnetConn ()
783783 case srvconn .ProtocolK8s :
784784 return s .getK8sConConn (proxyAddr )
785- case srvconn .ProtocolMySQL :
785+ case srvconn .ProtocolMySQL , srvconn . ProtocolMariadb :
786786 return s .getMysqlConn (proxyAddr )
787787 default :
788788 return nil , ErrUnMatchProtocol
@@ -816,7 +816,7 @@ func (s *Server) checkLoginConfirm() bool {
816816 targetId string
817817 )
818818 switch s .connOpts .ProtocolType {
819- case srvconn .ProtocolMySQL :
819+ case srvconn .ProtocolMySQL , srvconn . ProtocolMariadb :
820820 targetType = model .AppType
821821 targetId = s .connOpts .dbApp .ID
822822 case srvconn .ProtocolK8s :
@@ -872,7 +872,7 @@ func (s *Server) Proxy() {
872872 var proxyAddr * net.TCPAddr
873873 if s .domainGateways != nil && len (s .domainGateways .Gateways ) != 0 {
874874 switch s .connOpts .ProtocolType {
875- case srvconn .ProtocolMySQL , srvconn .ProtocolK8s :
875+ case srvconn .ProtocolMySQL , srvconn .ProtocolK8s , srvconn . ProtocolMariadb :
876876 dGateway , err := s .createAvailableGateWay (s .domainGateways )
877877 if err != nil {
878878 msg := i18n .T ("Start domain gateway failed %s" )
0 commit comments