系统服务-mysql
2021/8/1 2:06:00
本文主要是介绍系统服务-mysql,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
卸载mariadb
yum list installed | grep mariadb | awk '{print $1}' | xargs yum erase -y
添加mysqlyum源
wget https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm rpm -ivh mysql80-community-release-el7-3.noarch.rpm cp mysql-community.repo mysql-community.repo.bak sed -i 's#repo.mysql.com/yum#mirrors.tuna.tsinghua.edu.cn/mysql/yum#; s/mysql-\([0-9]\)\.\([0-9]\)/mysql\1\2/; s#/el/\([0-9]\)/#-el\1/#; s#$basearch/##' mysql-community.repo
- 默认安装了mysql8版本,要修改默认安装版本的话,可以直接修改mysql的yum源文件,yum配置文件里从5.5版本到8.0都有,只不过默认只开启了mysql8.0。更改别的版本记得将mysql8.0的源改为enable=0
执行安装
yum install mysql-community-server systemctl start mysqld systemctl enable mysqld
用户密码
#root用户设置密码 set global validate_password.policy =0; set global validate_password.length=1; alter user 'root'@'localhost' identified by '123.com'; #添加普通用户 create database cmdb; create user 'cmdb'@'192.168.0.%' identified with mysql_native_password by '123.com'; grant all privileges on cmdb.* to 'cmdb'@'192.168.0.%'; #重置用户密码 alter user 'cmdb'@'192.168.0.%' identified by 'abc.com';
这篇关于系统服务-mysql的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-12-07MySQL读写分离入门:轻松掌握数据库读写分离技术
- 2024-12-07MySQL读写分离入门教程
- 2024-12-07MySQL分库分表入门详解
- 2024-12-07MySQL分库分表入门指南
- 2024-12-07MySQL慢查询入门:快速掌握性能优化技巧
- 2024-12-07MySQL入门:新手必读的简单教程
- 2024-12-07MySQL入门:从零开始学习MySQL数据库
- 2024-12-07MySQL索引入门:新手快速掌握MySQL索引技巧
- 2024-12-06BinLog学习:MySQL数据库BinLog入门教程
- 2024-12-06Binlog学习:MySQL数据库的日志管理入门教程