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

linux: 银河麒麟v10安装mysql8

一,准备依赖环境

# yum install perl
# yum install net-tools
# yum install libaio-devel
# yum install numactl-devel

二,下载mysql源并安装

# wget https://dev.mysql.com/get/mysql80-community-release-el8-3.noarch.rpm

安装mysql源:

# rpm -ivh mysql80-community-release-el8-3.noarch.rpm

三,yum安装mysql

安装:

# yum install -y mysql-community-server --nogpgcheck

配置启动:

# systemctl status mysqld.service
● mysqld.service - MySQL ServerLoaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)Active: inactive (dead)Docs: man:mysqld(8)http://dev.mysql.com/doc/refman/en/using-systemd.html
# systemctl start mysqld.service
# systemctl status mysqld.service
● mysqld.service - MySQL ServerLoaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)Active: active (running) since Fri 2026-04-24 16:43:05 CST; 3s agoDocs: man:mysqld(8)http://dev.mysql.com/doc/refman/en/using-systemd.htmlProcess: 202363 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)Main PID: 202436 (mysqld)Status: "Server is operational"Tasks: 38Memory: 492.8MCGroup: /system.slice/mysqld.service└─202436 /usr/sbin/mysqldApr 24 16:42:54 ecm-qykwz-1-0002 systemd[1]: Starting MySQL Server...
Apr 24 16:43:05 ecm-qykwz-1-0002 systemd[1]: Started MySQL Server.

配置自启动:

# systemctl enable mysqld.service
# systemctl is-enabled mysqld.service
enabled

四,配置mysql账号:

1,得到临时密码

grep 'temporary password' /var/log/mysqld.log

2,用临时密码登录到mysql,修改密码并创建新账号

# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.46Copyright (c) 2000, 2026, 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> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.01 sec)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 -ADatabase changed
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '你的新密码';
Query OK, 0 rows affected (0.01 sec)mysql> CREATE USER 'root'@'%' IDENTIFIED BY '你的新密码';
Query OK, 0 rows affected (0.02 sec)mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
Query OK, 0 rows affected (0.01 sec)mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)mysql> exit
Bye

3,重启mysql

# systemctl restart mysqld.service
# systemctl status mysqld.service  

五,测试效果

# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.46 MySQL Community Server - GPLCopyright (c) 2000, 2026, 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>
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

 

http://www.jsqmd.com/news/696735/

相关文章:

  • NotaGen快速部署:一键启动WebUI,5分钟开始音乐创作之旅
  • 【SQL】SQL同环比计算的多种实现方式
  • Ostrakon-VL 扫描终端 C 语言接口封装实践:为传统应用注入视觉 AI 能力
  • 别再乱加120Ω电阻了!手把手教你根据通信距离和速度,为RS485/CAN总线配置正确的端接
  • 2026年3月真空浸糖机生产厂家推荐,毛辊清洗机/重量分选机/清洗蒸煮杀青设备/真空油炸机,真空浸糖机厂商哪家好 - 品牌推荐师
  • linux: 麒麟v10 yum安装php
  • Nordic nRF7001 WiFi 6伴生芯片解析与低功耗IoT应用
  • 基于eBPF的容器运行时安全监控:Foniod实战部署与策略指南
  • C语言中指针的重要性及其知识梳理
  • 告别截图!手把手教你用Mermaid.js在个人博客里画可交互流程图(附国内CDN)
  • 量子计算演进:从NISQ到FTQC的技术挑战与突破
  • flask:sqlalchemy:upgrade报错:Invalid use of NULL value
  • linux:银河麒麟服务器版安装python
  • PyQt5 QThread实战:告别界面卡顿,构建响应式GUI应用
  • LSTM在多元时间序列预测中的实战应用
  • 炉石传说终极插件指南:HsMod 完全配置手册
  • AI落地价值 = (高质量数据 × 精准问题定义) × AI能力
  • flask:用flasgger显示文档(flask+swagger)
  • [具身智能-431]:urdf-loaders ,目前 Web 端进行机械臂 URDF 3D 仿真最标准、最成熟的开源解决方案。
  • 使用CMSIS-DSP Python封装实现ECG信号滤波与嵌入式移植
  • linux: 查看银河麒麟的版本
  • [具身智能-436]:姿(Pose)、位置(Position)和姿态(Orientation)
  • 2026毕业季收藏:论文免费降AI率攻略,亲测AIGC从92%降到16%(含神级指令) - 降AI实验室
  • 端渲染?流渲染?到底怎么选!
  • 实战 | 解密CUTTag:从抗体选择到数据解读,关键环节逐一击破!
  • StructBERT-中文-large效果展示:LCQMC/STS/BQ多数据集验证的惊艳相似度匹配
  • Qwen3-4B-Instruct镜像免配置:log日志分级查看与错误码速查手册
  • Gradle、AGP、Plugin插件基本知识
  • 宏源期货白糖“保险+期货”项目助力罗城蔗农稳收增收
  • Bitwarden CLI受陷,被指与Checkmarx 供应链攻击有关