当前位置: 首页 > news >正文

使用mysql官网软件包安装mysql

确定你的操作系统,我的是Centos

在这里插入图片描述

myqsl 所有安装包的地址:https://repo.mysql.com/yum/

在这里插入图片描述

如果你是使用rpm安装你可以到对应的版本里面找到对应的包。

mysql 发行包的地址:http://repo.mysql.com/

在这里插入图片描述

在这里你可以找到对应的发布包安装。

这里使用yum的安装方式。

使用yum安装也有两种方式,下面介绍一下;

  1. 配置yum仓库,安装。

你可以修改为对应版本,这里使用的是mysql5.7

[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# cat mysql.repo 
[mysql-5.7-community]
name=mysql-5.7-community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
enabled=1
gpgcheck=0
[root@localhost yum.repos.d]# yum -y install mysql-community-server
[root@localhost yum.repos.d]# systemctl start mysqld
[root@localhost ~]# systemctl status mysqld
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since 五 2024-03-29 10:36:16 CST; 11min ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 8978 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
  Process: 8929 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
 Main PID: 8981 (mysqld)
   CGroup: /system.slice/mysqld.service
           └─8981 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

329 10:36:12 localhost.localdomain systemd[1]: Starting MySQL Server...
329 10:36:16 localhost.localdomain systemd[1]: Started MySQL Server.
  1. 安装发布包进行安装

你可以下载指定版本的发行包,这里使用的是mysql5.7

[root@localhost ~]# yum -y install http://repo.mysql.com/mysql57-community-release-el7.rpm
[root@localhost ~]# yum -y install mysql-community-server --nogpgcheck 
[root@localhost ~]# systemctl start mysqld
[root@localhost ~]# systemctl statusmysqld
  • --nogpgcheck 禁用gpg检查
    在这里插入图片描述

登录,并修改密码。

[root@localhost ~]#  grep 'temporary password' /var/log/mysqld.log

在这里插入图片描述

修改密码

MySQL 的 validate_password 插件是默认安装的。这要求密码至少包含 1 个大写字母、1 个小写字母、1 个数字和 1
个特殊字符,并且密码总长度至少为 8 个字符。

可以修改密码的强度,并修改密码的长度。

mysql> set global validate_password_policy=0;				设置密码的强度为低级	
mysql> set global validate_password_length=4;				设置密码的长度为4

在这里插入图片描述

mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)

mysql> set global validate_password_length=4;
Query OK, 0 rows affected (0.00 sec)

mysql>  ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.00 sec)

mysql> \q
Bye
[root@localhost ~]# mysql -uroot -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.44 MySQL Community Server (GPL)

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
http://www.dtcms.com/a/9824.html

相关文章:

  • GIT新建远程分支的操作过程
  • 京东云明修“价格战”,暗渡“政企云”
  • 数据结构:链表的双指针技巧
  • iOS苹果签名共享签名是什么以及如何获取?
  • Permission Denial: package=android does not belong to uid=2000
  • 6个黑科技网站,永久免费
  • 工艺品wordpress外贸主题
  • vscode连接不上,终端ssh正常,一直输入密码正确但是无法登录
  • 分布式理论:CAP理论 BASE理论
  • 【力扣】80.删除有序数组中的重复项Ⅱ
  • Android Fence机制
  • 手机销量分析案例
  • 服务器配置Huggingface并git clone模型和文件
  • 八大技术趋势案例(虚拟现实增强现实)
  • 芒果YOLOv5改进89:卷积SPConv篇,即插即用,去除特征图中的冗余,FLOPs 和参数急剧下降,提升小目标检测
  • 关于埃斯顿机器人安全区域不规则设置
  • FPGA之组合逻辑与时序逻辑
  • 2024年04月在线IDE流行度最新排名
  • 题解 -- 第六届蓝桥杯大赛软件赛决赛C/C++ 大学 C 组
  • 视频推拉流EasyDSS点播平台云端录像播放异常的问题排查与解决
  • mac 安装 pip,如果你的电脑已经有 python3
  • 网络套接字补充——TCP网络编程
  • C++ //练习 11.4 扩展你的程序,忽略大小写和标点。例如,“example.“、“exmaple,“和”Example“应该递增相同的计数器。
  • 使用node爬取视频网站里《龙珠》m3u8视频
  • 第十四届蓝桥杯(八题C++ 题目+代码+注解)
  • Python版【植物大战僵尸 +源码】
  • 非关系型数据库之Redis配置与优化
  • 【御控物联】JavaScript JSON结构转换(13):对象To数组——多层属性重组
  • 云计算面临的威胁
  • 【战略前沿】与中国达成生产协议后,飞行汽车即将起飞