当前位置:网站首页>MySQL的 安装、配置、卸载
MySQL的 安装、配置、卸载
2022-06-23 16:44:00 【用户7353950】
Mysql的安装配置(基于Centos7)
安装mysql数据库
[[email protected] ~]# wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
[[email protected] ~]# yum -y install mysql57-community-release-el7-9.noarch.rpm
[[email protected] ~]# cd /etc/yum.repos.d/
[[email protected] ~]# yum -y install mysql-server启动数据库
[[email protected] ~]# systemctil start mysqld查询初始化数据库密码
[[email protected] ~]# grep 'passowrd' /var/log/mysql.log
--显示的 [email protected]: ***就是初始化的数据库登录密码登录到数据库
[[email protected] ~]# mysql -uroot -p
[[email protected] ~]# password:设置密码
mysql> set password for 用户名@localhost = password('新密码');查看密码设置
mysql> show variables like 'validate_password%';修改密码等级为低
mysql> set global validate_password_policy=LOW;改密码长度最小为6位
mysql> set global validate_password_length=6;设置数据库新密码
mysql> set password for 'root'@'localhost' = password('bigdata');开启远程访问数据库
mysql> grant all privileges on *.* to 'root'@'%' identified by 'bigdata' with grant option;mysql> flush privileges;Mysql的完全卸载(基于Centos7)
查询与mysql有关的rpm包
[[email protected] ~]# rpm -qa |grep -i mysql
mysql57-community-release-el7-9.noarch
mysql-community-client-5.7.32-1.el7.x86_64
mysql-community-libs-5.7.32-1.el7.x86_64
mysql-community-libs-compat-5.7.32-1.el7.x86_64
mysql-community-common-5.7.32-1.el7.x86_64
mysql-community-server-5.7.32-1.el7.x86_64使用yum remove命令卸载这些包
[[email protected] ~]# yum remove mysql57-community-release-el7-9.noarch
[[email protected] ~]# yum remove mysql-community-client-5.7.32-1.el7.x86_64
[[email protected] ~]# yum remove mysql-community-libs-5.7.32-1.el7.x86_64
[[email protected] ~]# yum remove mysql-community-libs-compat-5.7.32-1.el7.x86_64
[[email protected] ~]# yum remove mysql-community-common-5.7.32-1.el7.x86_64
[[email protected] ~]# yum remove mysql-community-server-5.7.32-1.el7.x86_64查找mysql的相关目录残留并删除
[[email protected] ~]# find / -name mysql
/etc/selinux/targeted/active/modules/100/mysql
/var/lib/mysql
/var/lib/mysql/mysql
/usr/share/mysql删除残留
[[email protected] ~]# rm -rf /etc/selinux/targeted/active/modules/100/mysql
[[email protected] ~]# rm -rf /var/lib/mysql
[[email protected] ~]# rm -rf /var/lib/mysql/mysql
[[email protected] ~]# rm -rf /usr/share/mysql删除/var/log/mysqld.log
[[email protected] ~]# rm -rf /var/log/mysqld.log
--如果不删除这个文件,会导致新安装的mysql无法生存新密码,造成无法登陆mysql边栏推荐
- 酒店入住时间和离店时间的日期选择
- Apache foundation officially announced Apache inlong as a top-level project
- Date selection of hotel check-in time and check-out time
- TensorRT Paser加载onnx 推理使用
- Spdlog logging example - create a logger using sink
- Meituan Sanmian: how do you understand the principle of redis master-slave replication?
- ASEMI超快恢复二极管ES1J参数,ES1J封装,ES1J规格
- 图扑数字孪生 3D 风电场,智慧风电之海上风电
- QT布局管理器【QVBoxLayout,QHBoxLayout,QGridLayout】
- Innovative technology leader! Huawei cloud gaussdb won the 2022 authoritative award in the field of cloud native database
猜你喜欢

Asemi ultrafast recovery diode es1j parameters, es1j package, es1j specification

Ctfshow PHP features

Database Experiment 2 query

NPM install problem solving (NVM installation and use)

How to make sales management more efficient?

【30. 串联所有单词的子串】

Importance and purpose of test

Network remote access raspberry pie (VNC viewer)

QT布局管理器【QVBoxLayout,QHBoxLayout,QGridLayout】

What does the timestamp 90K mean?
随机推荐
Short video platform development, click the input box to automatically pop up the soft keyboard
JS common error reporting and exception capture
[network communication -- webrtc] analysis of webrtc source code -- supplement of pacingcontroller related knowledge points
Intel arc A380 graphics card message summary: the entry-level price products of running point and bright driving need to be optimized
图扑软件数字孪生挖掘机实现远程操控
What are the inductance parameters? How to choose inductance?
你的PCB地线走的对吗?为什么要有主地?
[network communication -- webrtc] source code analysis of webrtc -- bandwidth estimation at the receiving end
Get first and last days by year
C. Product 1 Modulo N-Codeforces Round #716 (Div. 2)
内网渗透令牌窃取
Importance and purpose of test
美团三面:聊聊你理解的Redis主从复制原理?
How about stock online account opening and account opening process? Is online account opening safe?
【30. 串联所有单词的子串】
Codeforces Round #620 (Div. 2)ABC
I successfully joined the company with 27K ByteDance. This interview notes on software testing has benefited me for life
ELK日志收集系统部署
解答02:Smith圓為什麼能“上感下容 左串右並”?
Asemi ultrafast recovery diode es1j parameters, es1j package, es1j specification