[admin@obp1 ~]$ mysql #之前未安装mysql客户端
mysql: unknown variable 'aracter-set=utf8'
[root@obp1 ~]# rpm -qa | grep mariadb
mariadb-5.5.68-1.el7.x86_64
mariadb-server-5.5.68-1.el7.x86_64
mariadb-libs-5.5.68-1.el7.x86_64
[root@obp1 ~]# rpm -e mariadb-server-5.5.68-1.el7.x86_64
warning: /var/log/mariadb/mariadb.log saved as /var/log/mariadb/mariadb.log.rpmsave
You have new mail in /var/spool/mail/root
[root@obp1 ~]# rpm -qa | grep mariadb
mariadb-5.5.68-1.el7.x86_64
mariadb-libs-5.5.68-1.el7.x86_64
[root@obp1 ~]# rpm -e mariadb-5.5.68-1.el7.x86_64
warning: /etc/my.cnf.d/client.cnf saved as /etc/my.cnf.d/client.cnf.rpmsave
[root@obp1 ~]# ls /etc/my.cnf
/etc/my.cnf
[root@obp1 ~]# view /etc/my.cnf
[root@obp1 ~]# mysql
-bash: /usr/bin/mysql: No such file or directory
my.cnf配置如下:
[admin@obp1 ~]$ cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
Settings userandgroup are ignored when systemd is used.
If you need to run mysqld under a different userorgroup,
customize your systemd unit file for mariadb according to the
instructions in http://fedoraproject.org/wiki/Systemd
initconnect='SET collationconnection = utf8unicodeci'
init_connect='SET NAMES utf8'character-set-server=utf8
collation-server=utf8unicodeci
skip-character-set-client-handshake
maxallowedpacket=1024M
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
includeall files from the config directory
!includedir /etc/my.cnf.d
[root@obp1 etc]# mv /etc/my.cnf.d/client.cnf.rpmsave /etc/my.cnf.d/client.cnf.rpmsave.orig
[root@obp1 etc]# cd my.cnf.d/
[root@obp1 my.cnf.d]# ls
client.cnf.rpmsave.orig mysql-clients.cnf
[root@obp1 my.cnf.d]# cp mysql-clients.cnf mysql-clients.cnf.orig
[root@obp1 my.cnf.d]# cat mysql-clients.cnf
These groups are read by MariaDB command-line tools
Use it foroptions that affect only one utility
[mysql]
aracter-set=utf8
[mysql_upgrade]
[mysqladmin]
[mysqlbinlog]
[mysqlcheck]
[mysqldump]
[mysqlimport]
[mysqlshow]
[mysqlslap]
3) 再次连接正常
[admin@obp1 ~]$ obclient -h192.168.80.25 -P2883 -uroot@tenant1#obcluster oceanbase -c -A -p'ob+pwd'
Welcome to the OceanBase. Commands end with ; or \g.
Your MySQL connection id is 3221492501
Server version: 5.7.25 OceanBase 3.1.0 (r3-b20901e8c84d3ea774beeaca963c67d7802e4b4e) (Built Aug 10 2021 07:51:04)
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [oceanbase]>