当前位置:网站首页>linux(centOs7)部署mysql(8.0.20)数据库
linux(centOs7)部署mysql(8.0.20)数据库
2022-08-05 00:48:00 【一只代码小白啦啦啦】
linux(centOs7)部署mysql(8.0.20)数据库,在腾讯云上面已经部署成功
环境配置:
腾讯轻量应用服务器,使用的是centos
下载链接
wget https://cdn.mysql.com/archives/mysql-8.0/mysql-8.0.20-1.el7.x86_64.rpm-bundle.tar
先在local创建mysql文件夹
cd /usr/local
mkdir mysql
解压
tar -xvf mysql-8.0.20-1.el7.x86_64.rpm-bundle.tar -C /usr/local/mysql
如果报错:
warning: mysql-community-libs-8.0.20-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
mariadb-libs is obsoleted by mysql-community-libs-8.0.20-1.el7.x86_64
解决方法:
#先卸载mysql-libs
yum remove mysql-libs
解压好文件按以下顺序安装
rpm -ivh mysql-community-common-8.0.20-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.20-1.el7.x86_64.rpm
rpm -ivh mysql-community-devel-8.0.20-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-8.0.20-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.20-1.el7.x86_64.rpm
yum install net-tools
rpm -ivh mysql-community-server-8.0.20-1.el7.x86_64.rpm
查看mysql状态systemctl status mysqld
启动mysql systemctl start mysqld
开机自启 systemctl enable mysqld
查看已经启动的服务(yum install net-tools)
netstat -tunlp
netstat -tunlp|grep mysql
查看mysql进程 ps -ef|grep mysql
Rpm安装固定路径
查阅数据库的临时密码
查看内容 cat /var/log/mysqld.log
查看临时密码 cat /var/log/mysqld.log|grep password
使用临时密码登录
mysql -uroot -p
设置密码最短长度
set global validate_password.length=4;
set global validate_password.policy=0;
这两种都可以试一下,忘记那个可以了
ALTER USER ‘root’@‘localhost’ IDENTIFIED BY 密码(要引号);
查看密码长度和验证策略
SHOW VARIABLES LIKE ‘validate_password%’;
设置mysql远程访问
use mysql
update user set host = ‘%’ where user = ‘root’;
flush privileges;
select user,host from user’;
边栏推荐
- tiup uninstall
- GCC: compile-time library path and runtime library path
- 数仓4.0(三)------数据仓库系统
- 软件测试面试题:软件测试类型都有哪些?
- Lattice PCIe 学习 1
- 深度学习训练前快速批量修改数据集中的图片名
- could not build server_names_hash, you should increase server_names_hash_bucket_size: 32
- 2022 Hangzhou Electric Power Multi-School Session 3 Question B Boss Rush
- Dynamic Programming/Knapsack Problem Summary/Summary - 01 Knapsack, Complete Knapsack
- ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionExcep
猜你喜欢
Introduction to JVM class loading
创意代码表白
深度学习训练前快速批量修改数据集中的图片名
动态规划/背包问题总结/小结——01背包、完全背包
Countdown to 1 day!From August 2nd to 4th, I will talk with you about open source and employment!
阶段性测试完成后,你进行缺陷分析了么?
VOC格式数据集转COCO格式数据集
MongoDB construction and basic operations
仅3w报价B站up主竟带来1200w播放!品牌高性价比B站投放标杆!
JVM类加载简介
随机推荐
FSAWS 的全球基础设施和网络
面试汇总:为何大厂面试官总问 Framework 的底层原理?
2022 Multi-school Second Session K Question Link with Bracket Sequence I
3. pcie.v 文件
Jin Jiu Yin Shi Interview and Job-hopping Season; Are You Ready?
Pytorch usage and tricks
Software testing interview questions: test life cycle, the test process is divided into several stages, and the meaning of each stage and the method used?
软件测试面试题:什么是软件测试?软件测试的目的与原则?
E - Many Operations (bitwise consideration + dp thought to record the result after the operation
工具类总结
数仓4.0(三)------数据仓库系统
Difference between MBps and Mbps
软件测试面试题:BIOS, Fat, IDE, Sata, SCSI, Ntfs windows NT?
"No title"
Zombie and orphan processes
leetcode: 266. All Palindromic Permutations
JUC线程池(一): FutureTask使用
SV class virtual method of polymorphism
Knowledge Points for Network Planning Designers' Morning Questions in November 2021 (Part 2)
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionExcep