赞
踩
find / -name mysql
rm -rf /var/lib/selinux/targeted/active/modules/100/mysql
rm -rf /usr/share/selinux/targeted/default/active/modules/100/mysql
yum search mysql
yum install -y mysql-server
systemctl enable mysqld
systemctl start mysqld
[root@078SeatDB ~]# systemctl status mysqld ● mysqld.service - MySQL 8.0 database server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2023-06-07 10:13:00 CST; 45min ago Process: 1394 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS) Process: 1113 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mysqld.service (code=exited, status=0/SUCCESS) Process: 1062 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS) Main PID: 1150 (mysqld) Status: "Server is operational" Tasks: 38 (limit: 24726) Memory: 456.7M CGroup: /system.slice/mysqld.service └─1150 /usr/libexec/mysqld --basedir=/usr Jun 07 10:12:57 078SeatDB systemd[1]: Starting MySQL 8.0 database server... Jun 07 10:13:00 078SeatDB systemd[1]: Started MySQL 8.0 database server.
mysql
ALTER USER 'root'@'localhost' IDENTIFIED BY 'aBC12345!';
exit
mysql -u root -paBC12345!
exit
create user zmrbak identified by '1234';
create database libVisits;
grant all privileges on libVisits.* to 'zmrbak'@'%' ;
grant select on mysql.* to 'zmrbak'@'%' ;
flush privileges;
alter user 'zmrbak'@'%' IDENTIFIED by 'ABC23456'
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload
接下来,就可以远程通过zmrbak来访问这个Mysql数据库了。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。