一、安装说明
1.1、相关说明:
Redhat8在线安装Mysql8数据库,使操作系统找到并自动安装自适应的版本及相关依赖组件;
1.2、系统版本
二、安装方法
2.1、下载应用软件
[root@GuoDC ~]# wget https://dev.mysql.com/get/mysql80-community-release-el8-4.noarch.rpm
2.2、安装应用软件
[root@GuoDC ~]# yum install mysql80-community-release-el8-4.noarch.rpm
2.3、安装检查应用
[root@GuoDC ~]# yum repolist enabled |grep "mysql.*-community.*"
2.4、禁用默认模块
[root@GuoDC ~]# yum module disable mysql
2.5、安装服务模块
[root@GuoDC ~]# yum install mysql-community-server
2.6、修改配置文件
[root@GuoDC ~]# vi /etc/my.cnf
character-set-server=gbk
lower_case_table_names=1
innodb_flush_log_at_trx_commit = 2
log-bin-trust-function-creators=1
2.7、应用初始化
[root@GuoDC ~]# /usr/sbin/mysqld --initialize-insecure --user=mysql --lower-case-table-names=1
2.8、启动数据库
[root@GuoDC ~]# systemctl start mysqld
2.9、登陆数据库
[root@GuoDC ~]# mysql -uroot -p
2.10、创建数据库
create database xXXXXsdb;
create database xXXXXshdb;
create database versiondb;
CREATE USER 'xXXXXs'@'localhost' IDENTIFIED BY 'XXXXXX';
GRANT ALL PRIVILEGES ON *.* TO 'xXXXXs'@'localhost' WITH GRANT OPTION;
CREATE USER 'xXXXXs'@'%' IDENTIFIED BY 'XXXXXX';
GRANT ALL PRIVILEGES ON *.* TO 'xXXXXs'@'%' WITH GRANT OPTION;
CREATE USER 'admin'@'localhost';
GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';
CREATE USER 'dummy'@'localhost';
use mysql;
update user set host = '%' where user = 'root' and host='localhost';
三、执行建库脚本
标签:GRANT,MySQL8,安装,mysql,root,GuoDC,localhost From: https://www.cnblogs.com/A121/p/17466985.html