首页
斐讯设备
疯言疯语
系统运维
编程语言
网站建设
友情连接
推荐
autojs
Search
1
charles破解注册码(含windows和mac)最新安装教程「亲测有效」
62 阅读
2
mac下的好用工具小身材大本领-NeatDownloadManager-ndm下载器
42 阅读
3
【N1和Armbian】一、N1刷Linux系统armbian
40 阅读
4
aris常用命令收集
37 阅读
5
docker更新现有容器为自动重启
36 阅读
登录
Search
标签搜索
JAVA
JAVA学习系列
docker
Linux
js
N1
git
模块二
模块一
端口
模块五
数据库
模块九
模块四
镜像
模块三
模块六
MySQL
百度网盘
nginx
DaiMaFengZi
累计撰写
596
篇文章
累计收到
11
条评论
首页
栏目
斐讯设备
疯言疯语
系统运维
编程语言
网站建设
页面
友情连接
推荐
autojs
搜索到
216
篇与
的结果
2023-11-07
【深度学习KylinOS三】【麒麟系统环境安装之Nginx】安装nginx--银河麒麟V10(Kylin Linux Advanced Server release V10 (Tercel))操作系统
服务器环境在 arm64(aarch64) 架构服务器上基于国产化操作系统安装 Nginx 服务获取源代码软件获取门路:http://nginx.org/download/nginx官网:http://nginx.org/编译前期情况设置履行如下下令,装置依附包。yum install gcc gcc-c++ make unzip pcre pcre-devel zlib zlib-devel libxml2 libxml2-devel readline readline-devel ncurses ncurses-devel perl-devel perl-ExtUtils-Embed openssl-devel -y编译源代码并安装履行以下下令,获取装置包。wget -c http://nginx.org/download/nginx-1.16.1.tar.gz履行以下下令,解压装置包。tar -zxvf nginx-1.16.1.tar.gz履行以下下令,进入装置目次。cd nginx-1.16.1履行以下下令,编译装置nginx。./configure make -j4 && make install测试已实现编译的软件新增nginx用户useradd nginx履行以下下令,给nginx用户开启nginx装置目次权限。chown nginx:nginx /usr/local/nginx履行如下下令,检查nginx版本。cd /usr/local/nginx/sbin/ ./nginx -v启动nginxcd /usr/local/nginx/sbin/ ./nginx检查能否启动胜利ps -ef | grep nginx设置nginx开机自启动进入到/lib/systemd/system/目次cd /lib/systemd/system/创立nginx.service文件,并编纂# vim nginx.service [Unit] Description=nginx After=network.target [Service] Type=forking ExecStart=/usr/local/nginx/sbin/nginx -c conf/nginx.conf ExecReload=/usr/local/nginx/sbin/nginx -s reload ExecStop=/usr/local/nginx/sbin/nginx -s quit PrivateTmp=true [Install] WantedBy=multi-user.target参加开机自启动systemctl enable nginx #假如不想开机自启动了,能够应用上面的下令撤消开机自启动 systemctl disable nginx效劳的启动/结束/革新设置文件/检查状况#systemctl start nginx.service 启动nginx效劳 # systemctl stop nginx.service 结束效劳 # systemctl restart nginx.service 从新启动效劳 # systemctl list-units --type=service 检查全部已启动的效劳 # systemctl status nginx.service 检查效劳以后状况 # systemctl enable nginx.service 设置开机自启动 # systemctl disable nginx.service 结束开机自启动一个罕见的过错Warning: nginx.service changed on disk. Run 'systemctl daemon-reload' to reload units.直接依照提醒履行下令systemctl daemon-reload 即可。systemctl daemon-reload
2023年11月07日
3 阅读
0 评论
0 点赞
2023-11-07
【深度学习KylinOS二】【麒麟系统环境安装之Mysql】银河麒麟服务器V10 aarch64安装mysql8.0教程
服务器环境在 arm64(aarch64) 架构服务器上基于国产化操作系统安装 Mysql 服务## 查看系统版本,确认版本 cat /etc/kylin-release Kylin Linux Advanced Server release V10 (Tercel) ## 操作系统 uname -p aarch64 ## 内核版本(≥ 3.10) uname -r 4. 19.90-21.2.ky10.aarch64 ## iptables 版本(≥ 1.4) iptables --version iptables v1.8.1 (legacy)软件安装需先卸载mariadb-server、mariadb-commonyum remove mariadb-server mariadb-common下载安装包下载地址:https://downloads.mysql.com/archives/community/可以直接用命令下载:wget -c https://downloads.mysql.com/archives/get/p/23/file/mysql-8.1.0-1.el8.aarch64.rpm-bundle.tar解压:tar xvf mysql-8.1.0-1.el8.aarch64.rpm-bundle.tar安装:yum install -y ./mysql-community-server-8.1.0-1.el8.x86_64.rpm yum install -y ./mysql-community-client-8.1.0-1.el8.x86_64.rpm yum install -y ./mysql-community-libs-8.1.0-1.el8.x86_64.rpm yum install -y ./mysql-community-server-8.1.0-1.el8.x86_64.rpm yum install -y ./mysql-community-common-8.1.0-1.el8.x86_64.rpm 如果嫌弃麻烦,那就直接全部安装 yum install -y ./mysql-community-*启动mysqldsystemctl start mysqld设置开机启动systemctl enable mysqldMySQL默认密码和修改密码grep 'temporary password' /var/log/mysqld.log mysql -uroot -p修改密码ALTER USER 'root'@'localhost' IDENTIFIED BY 'sfa33afFASD!@#';重新登录搞定收工
2023年11月07日
1 阅读
0 评论
0 点赞
2023-11-06
【深度学习KylinOS一】【麒麟系统环境安装之Docker】麒麟系统V10 怎么使用自带的docker 麒麟系统安装docker
服务器环境在 arm64(aarch64) 架构服务器上基于国产化操作系统安装 docker 服务## 查看系统版本,确认版本 cat /etc/kylin-release Kylin Linux Advanced Server release V10 (Tercel) ## 操作系统 uname -p aarch64 ## 内核版本(≥ 3.10) uname -r 4. 19.90-21.2.ky10.aarch64 ## iptables 版本(≥ 1.4) iptables --version iptables v1.8.1 (legacy)吐槽所谓的国产操作系统在我看来即换皮改名操作系统,不可否认他们在权限审计方面做的比原版开源的操作系统更复杂更细腻(但是这些应该都可以自己通过 PAM 之类的配置吧)。由于工作原因需要接触当前主流的大部分 GNU/Linux、*BSD、国产操作系统,在目前已接触的多款所谓的基于 Debian 或 Fedora 二次开发的操作系统中感触最深的不是他们上面加的各种权限审计限制,而是他们改了包名导致在安装 deb 或者 rpm 包时出现各种依赖问题。例如 CentOS7 的 rpm 包标识为 el7 麒麟上面则改成了 ky10,在安装一些软件时由于依赖问题导致同名包安装不上,如果卸载系统上已有包可能会出现系统某些软件服务出现问题,如果不卸载则只能带上痛苦面具去解决冲突。真就自主研发靠改名了。国产的各种麒麟操作系统由于使用者多为政府单位,运行环境又是隔离内网,导致一般情况下只有安装光盘没有完整的软件源寻找软件源据说银河麒麟基于 CentOS7,但是通过测试最终添加 CentOS8 的源才可以用,因为他喵的 CentOS7 只有 x86_64,而 CentOS8 才有 aarch64,厂商的话都信不得哦。手动配置了 CentOS8 的源后,yum makecache 可以正常缓存,但是 yum -y update 会出现多个依赖错误问题,通过 yum -y install package-name 可以安装软件,但是依赖问题依然很难受。最终在配置好 CentOS8 与 Docker-ce 官方源后由于依赖问题放弃了通过 yum 在线安装,直接下载如下 rpm 包安装依然不行。通过二进制安装 docker通过在线软件源和 rpm 包不能直接安装,那么只能选择通过编译安装了,去官网找了下发现提供有编译好的 docker 二进制包,直接下载二进制包安装吧,感谢 golang 的跨平台性。安装条件64位的操作系统# uname -p aarch64Linux 内核版本 ≥ 3.10# uname -r 4. 19.90-17.ky10.aarch64iptables 版本 ≥ 1.4# iptables --version iptables v1.8.1 (legacy)一个 ps 可执行文件,通常由 procps 或类似的包提供。安装 Docker选择并下载 docker-ce 二进制包文件官网下载地址: Index of linux/static/stable/aarch64/wget https://download.docker.com/linux/static/stable/aarch64/docker-20.10.7.tgz解压下载好的压缩包tar -zxvf docker-20.10.7.tgz移动解压出来的二进制文件到 /usr/bin 目录中mv docker/* /usr/bin/测试启动dockerd添加 systemd添加 docker 的 systemd 服务脚本至 /usr/lib/systemd/system/脚本参考自 https://github.com/docker/docker-cevim /usr/lib/systemd/system/docker.service [Unit] Description=Docker Application Container Engine Documentation=https://docs.docker.com After=network-online.target docker.socket firewalld.service containerd.service Wants=network-online.target Requires=docker.socket containerd.service [Service] Type=notify # the default is not to use systemd for cgroups because the delegate issues still # exists and systemd currently does not support the cgroup feature set required # for containers run by docker ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock ExecReload=/bin/kill -s HUP $MAINPID TimeoutStartSec=0 RestartSec=2 Restart=always # Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229. # Both the old, and new location are accepted by systemd 229 and up, so using the old location # to make them work for either version of systemd. StartLimitBurst=3 # Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230. # Both the old, and new name are accepted by systemd 230 and up, so using the old name to make # this option work for either version of systemd. StartLimitInterval=60s # Having non-zero Limit*s causes performance problems due to accounting overhead # in the kernel. We recommend using cgroups to do container-local accounting. LimitNOFILE=infinity LimitNPROC=infinity LimitCORE=infinity # Comment TasksMax if your systemd version does not support it. # Only systemd 226 and above support this option. TasksMax=infinity # set delegate yes so that systemd does not reset the cgroups of docker containers Delegate=yes # kill only the docker process, not all processes in the cgroup KillMode=process OOMScoreAdjust=-500 [Install] WantedBy=multi-user.target根据 docker.service 中 Unit.After 需求添加 docker.socket 脚本至 /usr/lib/systemd/system/脚本参考自 https://github.com/docker/docker-cevim /usr/lib/systemd/system/docker.socket [Unit] Description=Docker Socket for the API [Socket] # If /var/run is not implemented as a symlink to /run, you may need to # specify ListenStream=/var/run/docker.sock instead. ListenStream=/run/docker.sock SocketMode=0660 SocketUser=root SocketGroup=docker [Install] WantedBy=sockets.target注意:如果缺少该文件,启动 docker 时会报如下错误:# systemctl start docker Failed to start docker.service: Unit docker.socket not found.根据 docker.service 中 Unit.After 需求添加 containerd.service 脚本至 /usr/lib/systemd/system/vim /usr/lib/systemd/system/containerd.service # Copyright The containerd Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. [Unit] Description=containerd container runtime Documentation=https://containerd.io After=network.target local-fs.target [Service] ExecStartPre=-/sbin/modprobe overlay ExecStart=/usr/bin/containerd Type=notify Delegate=yes KillMode=process Restart=always RestartSec=5 # Having non-zero Limit*s causes performance problems due to accounting overhead # in the kernel. We recommend using cgroups to do container-local accounting. LimitNPROC=infinity LimitCORE=infinity LimitNOFILE=infinity # Comment TasksMax if your systemd version does not supports it. # Only systemd 226 and above support this version. TasksMax=infinity OOMScoreAdjust=-999 [Install] WantedBy=multi-user.target注意:如果缺少该文件,启动 docker 时会报如下错误:# systemctl restart docker Failed to restart docker.service: Unit containerd.service not found.重载 systemd 配置文件systemctl daemon-reload创建 docker 组groupadd docker如不创建 docker 组在通过 systemctl 启动时会报错如下Dependency failed for Docker Application Container Engine. Job docker.service/start failed with result 'dependency'.启动 docker 服务systemctl start docker systemctl enable docker修改 docker 配置文件并查看安装好的 docker 基本信息在 /etc/docker/daemon.json 中添加如下内容:vim /etc/docker/daemon.json vim /etc/docker/daemon.json { "data-root":"/data/docker", "exec-opts":[ "native.cgroupdriver=systemd" ] }重启 docker 服务systemctl restart docker查看 docker info常用操作命令1.查看系统版本,确认版本 # cat /etc/kylin-release Kylin Linux Advanced Server release V10 (Tercel) 2. 查看系统架构(服务器如果是鲲鹏,架构是aarch64) # uname -p aarch64 3. 内核版本 # uname -r 4. 19.90-23.8.v2101.ky10.aarch64 4. iptables版本 # iptables --version iptables v1.8.1 (legacy) 5. 启动docker systemctl start docker systemctl enable docker 6. 获取操作系统的版本详细信息 lsb_release -a(第一种) cat /etc/os-release (第二种) 7. 查看系统是64位还是32位 第一种方式:getconf LONG_BIT 第二种方式:file /bin/ls 第三种方式:lsb_release -a 8. 查看linux版本 第一种方式使用这个命令查看 lsb_release -a 第二种方式使用这个命令查看cat /etc/issue(仅适用于linux) 第三种方式使用这个命令查看 执行cat /etc/redhat-release 9. 查看CPU配置信息 cat /proc/cpuinfo lscpu 10. 查看内存配置信息 cat /proc/meminfo 11. 查看硬盘信息 df -h 12. 查看当前linux的版本 cat /etc/redhat-release rpm -q centos-release 13. 修改DNS配置 vim /etc/resolv.conf 14. 查看外网IP curl cip.cc curl ifconfig.me curl ipinfo.io 15. 获取操作系统分支号 hostnamectl
2023年11月06日
5 阅读
0 评论
0 点赞
2023-10-26
LINUX 防火墙开放端口,查看状态,查看开放端口
1.查看防火墙状态:active (running) 即是开启状态systemctl status firewalld查看已开发端口命令:firewall-cmd --list-all新增防火墙开放端口:firewall-cmd --zone=public --add-port=3306/tcp --permanent开放端口后需要重新加载防火墙:firewall-cmd --reloadfirewalld的基本使用命令:启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status firewalld 开机禁用 : systemctl disable firewalld 开机启用 : systemctl enable firewalld配置firewalld-cmd命令查看版本: firewall-cmd --version 查看帮助: firewall-cmd --help 显示状态: firewall-cmd --state 查看所有打开的端口: firewall-cmd --zone=public --list-ports 更新防火墙规则: firewall-cmd --reload 查看区域信息: firewall-cmd --get-active-zones 查看指定接口所属区域: firewall-cmd --get-zone-of-interface=eth0 拒绝所有包:firewall-cmd --panic-on 取消拒绝状态: firewall-cmd --panic-off 查看是否拒绝: firewall-cmd --query-panicsystemctl相关命令启动一个服务:systemctl start firewalld.service 关闭一个服务:systemctl stop firewalld.service 重启一个服务:systemctl restart firewalld.service 显示一个服务的状态:systemctl status firewalld.service 在开机时启用一个服务:systemctl enable firewalld.service 在开机时禁用一个服务:systemctl disable firewalld.service 查看服务是否开机启动:systemctl is-enabled firewalld.service 查看已启动的服务列表:systemctl list-unit-files|grep enabled 查看启动失败的服务列表:systemctl --failed
2023年10月26日
0 阅读
0 评论
0 点赞
2023-10-24
【环境安装记录深入学习一:mysql数据库使用移动目录的方式进行迁移】Linux环境MySQL 的迁移(对data目录的直接拷贝)
MySQL迁移文档在虚拟机的测试MySQL直接复制data目录方式迁移测试环境服务器A: centos-release-7-8.2003.0.el7.centos.x86_64/MySQL 5.7.32 服务器B: centos-release-7-8.2003.0.el7.centos.x86_64/MySQL 5.7.32迁移步骤停止服务器A和服务器B的MySQL服务systemctl stop mysqld将服务器A的MySQL的data目录从服务器A,除了ib_logfile*外统一复制到服务器B的data目录下可能会报错,可以用cat /var/log/mysqld.log查看日志数据拷贝完成后:##进入到拷贝数据的目录 cd /var/lib/mysql/ ##因为上传的数据拥有者是root,我们需要变更成mysql chown -R mysql.mysql * ##这一步暂定,如果有报错,说无权限,则 chmod -R 777 * ## 配置文件中加上 lower_case_table_names=1 即可。 #是否对sql语句大小写敏感,1表示不敏感 vim /etc/my.cnf #加上这句话 lower_case_table_names=1报错解决办法报错一:mysqld: File '.\binlog.000005' not found (OS errno 2 - No such file or directory) 2022-07-19T01:01:20.153111Z 0 [ERROR] [MY-010958] [Server] Could not open log file. 2022-07-19T01:01:20.154277Z 0 [ERROR] [MY-010041] [Server] Can't init tc log提示找不到 “binlog.000005”文件,由于打不开这个文件,因此启动终止。这个是MySQL运行时使用的二进制日志文件,主要用于记录更改数据的语句,这里由于不知何种原因被删除了,造成MySQL服务无法正常启动。.\binlog.000004 .\binlog.000005解决方案可以看到最后一个文件为“binlog.000005”,解决的办法很简单,就是删除“binlog.index”文件,这样MySQL将默认重建“binlog.000001”二进制日志文件,MySQL服务正常启动!最后的最后systemctl start mysqld
2023年10月24日
1 阅读
0 评论
0 点赞
2023-10-24
windows server2016激活方法+密钥
Windows Server 2016激活方法及密钥激活方法Windows Server 2016的激活方法有多种,包括使用KMS激活、MAK激活、使用激活工具等。使用MAK密钥进行激活以下是使用MAK密钥进行激活的示例:slmgr /skms kms.03k.org slmgr /ipk WC2BQ-8NRM3-FDDYY-2BFGV-KHKQY slmgr /ato在上面的示例中,我们使用slmgr命令行工具来进行激活。首先,我们使用slmgr /ipk命令来安装密钥,然后使用slmgr /ato命令来激活系统。当我们执行这个命令时,会提示激活成功。
2023年10月24日
0 阅读
0 评论
0 点赞
2023-10-24
【环境安装记录深入浅出Mysql的2059错误篇】2059-Authentication plugin ‘caching_sha2_password‘ 问题出现的原因及解决方法
2059-Authentication plugin ‘caching_sha2_password‘ cannot be loaded:问题出现的原因及解决方法1.出现原因安装的时候,选择了强加密规则caching_sha2_password,与之前的mysql的mysql_native_password规则不同,navicate驱动目前不支持新加密规则2.解决方法通过更改加密规则和刷新权限的方式mysql -uroot -ppassword #登录 use mysql; #选择数据库 # 远程连接请将'localhost'换成'%' ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; #更改加密方式 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; #更新用户密码 FLUSH PRIVILEGES; #刷新权限
2023年10月24日
13 阅读
0 评论
0 点赞
2023-10-24
【环境安装记录指定Mysql版本篇】CentOS7 离线安装mysql8数据库
第一步:下载离线安装包下载地址:https://dev.mysql.com/downloads/第二步:上传下载包到服务器上传文件mysql-8.0.18-1.el7.x86_64.rpm-bundle.tar到服务器上。第三步:解压文件包切换到上传文件目录下运行如下命令:[root@gelong-vm1 rpms]# tar -vxf mysql-8.0.18-1.el7.x86_64.rpm-bundle.tar mysql-community-libs-8.0.18-1.el7.x86_64.rpm mysql-community-devel-8.0.18-1.el7.x86_64.rpm mysql-community-embedded-compat-8.0.18-1.el7.x86_64.rpm mysql-community-libs-compat-8.0.18-1.el7.x86_64.rpm mysql-community-common-8.0.18-1.el7.x86_64.rpm mysql-community-test-8.0.18-1.el7.x86_64.rpm mysql-community-server-8.0.18-1.el7.x86_64.rpm mysql-community-client-8.0.18-1.el7.x86_64.rpm 第四步:卸载系统自带的数据库1.检查系统自带的 MariaDB检查系统是否自带MariaDB,命令如下:rpm -qa | grep mariadb如果系统自带MariaDB,删除掉,删除命令如下:rpm -e --nodeps mariadb-libs-5.5.44-2.el7.centos.x86_642.检查系统自带的mysql数据库安装包检查系统是否自带Mysql数据库,名利如下:rpm -qa | grep mysql如果系统自带mysql数据库,删除掉,删除命令如下:rpm -e --nodeps mysql-libs-5.1.73-8.el6_8.x86_64第五步:按照顺序安装mysql数据库按照如下顺序安装:rpm -ivh mysql-community-common-8.0.18-1.el7.x86_64.rpm rpm -ivh mysql-community-libs-8.0.18-1.el7.x86_64.rpm rpm -ivh mysql-community-client-8.0.18-1.el7.x86_64.rpm rpm -ivh mysql-community-server-8.0.18-1.el7.x86_64.rpm rpm -ivh mysql-community-devel-8.0.18-1.el7.x86_64.rpm1.安装mysql-community-server-8.0.18-1.el7.x86_64.rpm 报错解决方案安装 mysql-community-server-8.0.18-1.el7.x86_64.rpm 的时候需要依赖 net-tools,如果没有 net-tools 会安装失败,此时先安装 net-tools,然后再安装 mysql-community-server-8.0.18-1.el7.x86_64.rpm 即可,安装命令如下:# 安装 mysql-community-server-8.0.25-1.el7.x86_64.rpm 依赖报错 [root@sangni mysql-installation]# rpm -ivh mysql-community-server-8.0.25-1.el7.x86_64.rpm 警告:mysql-community-server-8.0.25-1.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY 错误:依赖检测失败: net-tools 被 mysql-community-server-8.0.25-1.el7.x86_64 需要 # 安装 net-tools [root@sangni mysql-installation]# yum install net-tools 已加载插件:fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.njupt.edu.cn * extras: mirrors.njupt.edu.cn * updates: mirrors.njupt.edu.cn 正在解决依赖关系 --> 正在检查事务 ---> 软件包 net-tools.x86_64.0.2.0-0.25.20131004git.el7 将被 安装 --> 解决依赖关系完成 依赖关系解决 ================================================================================================================================== Package 架构 版本 源 大小 ================================================================================================================================== 正在安装: net-tools x86_64 2.0-0.25.20131004git.el7 base 306 k 事务概要 ================================================================================================================================== 安装 1 软件包 总下载量:306 k 安装大小:917 k Is this ok [y/d/N]: y Downloading packages: net-tools-2.0-0.25.20131004git.el7.x86_64.rpm | 306 kB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction 警告:RPM 数据库已被非 yum 程序修改。 ** 发现 2 个已存在的 RPM 数据库问题, 'yum check' 输出如下: 2:postfix-2.10.1-9.el7.x86_64 有缺少的需求 libmysqlclient.so.18()(64bit) 2:postfix-2.10.1-9.el7.x86_64 有缺少的需求 libmysqlclient.so.18(libmysqlclient_18)(64bit) 正在安装 : net-tools-2.0-0.25.20131004git.el7.x86_64 1/1 验证中 : net-tools-2.0-0.25.20131004git.el7.x86_64 1/1 已安装: net-tools.x86_64 0:2.0-0.25.20131004git.el7 完毕! # net-tools 安装完成后再次安装 mysql-community-server-8.0.25-1.el7.x86_64.rpm [root@sangni mysql-installation]# rpm -ivh mysql-community-server-8.0.25-1.el7.x86_64.rpm 警告:mysql-community-server-8.0.25-1.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY 准备中... ################################# [100%] 正在升级/安装... 1:mysql-community-server-8.0.25-1.e################################# [100%]2.安装 rpm -ivh mysql-community-devel-8.0.18-1.el7.x86_64.rpm 报错解决方案[root@192 mysql]# rpm -ivh mysql-community-devel-8.0.18-1.el7.x86_64.rpm warning: mysql-community-devel-8.0.25-1.el7.x86_64.rpm: Header V3 DSA/SHA256 Signature, key ID 5072e1f5: NOKEY error: Failed dependencies: pkgconfig(openssl) is needed by mysql-community-devel-8.0.25-1.el7.x86_64解决办法yum install openssl-devel特别说明:关于mysql8之后的大小写问题在MySQL8中,数据目录初始化之后,不再允许更改lower_case_table_names=1的值;也就是说启动(重启)MYSQL时,lower_case_table_names的值必须于,初始化MYSOL时(安装 MYSOL后的首次启动)的值相同。由于我的业务是有需求的,所以我先设置关闭大小写验证 #进入目录 cd /etc/ #编辑my.cnf文件 vi /etc/my.cnf #添加内容 lower_case_table_names=1通常,0 表示大小写敏感,1 表示大小写不敏感。相关文章:CentOS 上查看 MySQL 的大小写敏感状态centos 安装MySQL 8.0 区分大小写解决方法第六步:启动mysql服务1.启动MYSQL服务:[root@gelong-vm1 rpms]# service mysqld start Redirecting to /bin/systemctl start mysqld.service2.查看启动状态:[root@gelong-vm1 rpms]# systemctl status mysqld.service ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since 二 2023-09-05 14:19:46 CST; 38s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 15236 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Main PID: 15315 (mysqld) Status: "Server is operational" CGroup: /system.slice/mysqld.service └─15315 /usr/sbin/mysqld 9月 05 14:19:34 gelong-vm1 systemd[1]: Starting MySQL Server... 9月 05 14:19:46 gelong-vm1 systemd[1]: Started MySQL Server.第七步:修改默认密码开启远程连接1.查看默认密码:查看默认密码命令如下[root@gelong-vm1 rpms]# grep 'temporary password' /var/log/mysqld.log 2023-09-05T06:19:39.121134Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: iU/%Q(3w<AO*2.使用默认密码登录mysql:[root@gelong-vm1 rpms]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.23 Copyright (c) 2000, 2021, 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.3.修改 root 用户密码:注意:这里修改的密码要足够复杂,包含大小和特殊符号;mysql> alter user 'root'@'localhost' identified by 'Houpu123!@#'; Query OK, 0 rows affected (0.62 sec) mysql> select version(); +-----------+ | version() | +-----------+ | 8.0.23 | +-----------+ 1 row in set (0.00 sec)4.修改 root 用户的 host 列值,开启远程连接:修改运行远程连接命令如下:mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> UPDATE user SET `Host` = '%' WHERE `User` = 'root' LIMIT 1; Query OK, 1 row affected (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> select host from user; +-----------+ | host | +-----------+ | % | | localhost | | localhost | | localhost | +-----------+ 4 rows in set (0.00 sec)5.刷新缓存:重新刷新mysql的缓存内容命令:mysql> flush privileges; Query OK, 0 rows affected (0.47 sec) 6.给 root 用户授予所有权限:mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION; Query OK, 0 rows affected (0.02 sec) 解决远程连接时报错2059-Authentication plugin ‘caching_sha2_password‘安装的时候,选择了强加密规则caching_sha2_password,与之前的mysql的mysql_native_password规则不同,navicate驱动目前不支持新加密规则通过更改加密规则和刷新权限的方式 use mysql; #选择数据库 # 远程连接请将'%'换成'localhost' ALTER USER 'root'@'%' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; #更改加密方式 ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password'; #更新用户密码 FLUSH PRIVILEGES; #刷新权限8.退出mysql控制台:exit;
2023年10月24日
1 阅读
0 评论
0 点赞
1
...
16
17
18
...
27