数据库
首页 > 数据库> > 系统服务-mysql

系统服务-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

执行安装

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';

标签:服务,系统,community,repo,yum,mysql,com,cmdb
来源: https://www.cnblogs.com/yunwei/p/15085543.html