标签:galera update ase comm client 完成 query tcp perm
# 解压离线rpm包
tar -xvf Mariadb5.5.56.tar
cd Mariadb5.5.56
# 原生CentOS7需要安装这个,红旗不需要请忽略
rpm -ivh libpcap-1.5.3-8.axs7.x86_64.rpm
# 安装mariadb的rpm依赖包
rpm -ivh rsync-3.0.9-17.axs7.x86_64.rpm nmap-* lsof-4.87-4.axs7.x86_64.rpm perl-* boost-*
# 搜索 没有搜索结果直接跳过下一步卸载
rpm -qa | grep mariadb-libs
# 卸载 将搜索结果复制到卸载命令
rpm -ev --nodeps [搜索结果]
# 安装mariadb
rpm -ivh jemalloc-3.6.0-1.el7.x86_64.rpm jemalloc-devel-3.6.0-1.el7.x86_64.rpm
rpm -ivh galera-25.3.20-1.rhel7.el7.centos.x86_64.rpm
rpm -ivh MariaDB-5.5.56-centos7-x86_64-common.rpm MariaDB-5.5.56-centos7-x86_64-compat.rpm MariaDB-5.5.56-centos7-x86_64-client.rpm MariaDB-5.5.56-centos7-x86_64-server.rpm
# 安装完成
# 开启mysql
service mysql start
# 查看状态
service mysql status
# 执行mysql初始化脚本
mysql_secure_installation
# 输入root密码; 初始安装完没密码直接回车
Enter current password for root (enter for none):
# 为root设置密码; y 设置
Set root password? [Y/n] y
# 两次密码一直成功
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
# 是否移除匿名用户; y 移除
Remove anonymous users? [Y/n] y
# 是否开启远程登录; y 开启
Disallow root login remotely? [Y/n] y
# 是否删除test数据库; y 删除
Remove test database and access to it? [Y/n] y
# 是否重新加载权限; y 加载
Reload privilege tables now? [Y/n] y
# 完成
# 登录mysql
mysql -u root -p
// 开启远程连接权限
grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘root密码‘;flush privileges;
# 完成
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload
firewall-cmd --zone=public --query-port=3306/tcp
// mysql发现找不到2、3所说文件,但是只修改第一个,查看编码修改成功.可自行选择跳过2、3步
// 1.编辑/etc/my.cnf
vi /etc/my.cnf
// [mysqld]标签下添加
init_connect=‘SET collation_connection = utf8mb4_unicode_ci‘
init_connect=‘SET NAMES utf8mb4‘
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
skip-character-set-client-handshake
// 2.编辑/etc/my.cnf.d/client.cnf
vi /etc/my.cnf.d/client.cnf
// 在[client]中添加
default-character-set=utf8mb4
// 3.编辑/etc/my.cnf.d/mysql-clients.cnf
vi /etc/my.cnf.d/mysql-clients.cnf
// 在[mysql]中添加
default-character-set=utf8mb4
// 4.全部配置完成,重启mariadb
systemctl restart mariadb
// 5.之后进入MariaDB查看字符集
mysql> show variables like "%character%";show variables like "%collation%";
# 测试连接
mysql
# 修改密码,初始密码为空可以直接回车
update user set authentication_string=PASSWORD("123456") where user="root";
# 刷新
flush privileges;
# 退出
exit;
标签:galera update ase comm client 完成 query tcp perm
原文地址:https://www.cnblogs.com/xxjs/p/12069387.html