安装MySQL的五种方法(Linux系统和Windows系统)

一.在Linux系统中安装MySQL

第一种方法:在线YUM仓库

首先打开MySQL官网首页 www.mysql.com

找到【DOWNLOADS】选项,点击

下拉,找到 【MySQL Community(GPL) Downloads】

  在社区版下载页面中,【 MySQL Yum Repository 】链接为在线仓库安装,【 MySQL Community
Server 】链接为二进制安装和源码安装,【 MySQL Installer for Windows 】为之前老版本在 Windows 平台安装使用,新版本已经不可以用。

 

点击【 MySQL Yum Repository 】链接之后,进入在线仓库安装页面,单击【 Download 】按钮进入仓库 下载确认页面。

 

点击确认链接后,浏览器会自动下载仓库安装包,可以将安装包下载好传送到 Linux 操作系统中
也可以 将该安装包的下载链接在Linux 操作系统中按照以下命令直接进行下载。
wget https://repo.mysql.com//mysql84-community-release-el9-1.noarch.rpm

可以使用rpm直接安装

 

rpm -i https://repo.mysql.com//mysql84-community-release-el9-1.noarch.rpmdnf repolistdnf install mysql-server

 

[root@MySQL ~]# rpm -i https://repo.mysql.com//mysql84-community-releaseel9-1.noarch.rpm
warning: /var/tmp/rpm-tmp.QsZluK: Header V4 RSA/SHA256 Signature, key ID
a8d3785c: NOKEY
[root@MySQL ~]# dnf repolist
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use "rhc"
or "subscription-manager" to register.
repo id repo
name
appstream
appstream
baseos
baseos
mysql-8.4-lts-community
MySQL 8.4 LTS Community Server
mysql-connectors-community
MySQL Connectors Community
mysql-tools-8.4-lts-community
MySQL Tools 8.4 LTS Community[root@MySQL ~]# dnf install mysql-server
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use "rhc"
or "subscription-manager" to register.
Last metadata expiration check: 0:03:04 ago on Mon 30 Dec 2024 12:30:35 PM
CST.
Dependencies resolved.
============================================================================
=====================================================================
Package Architecture
Version Repository Size
============================================================================
=====================================================================
Installing:
mysql-community-server x86_64
8.4.3-1.el9 mysql-8.4-lts-community 50 M
Installing dependencies:
mysql-community-client x86_64
8.4.3-1.el9 mysql-8.4-lts-community 3.1 M
mysql-community-client-plugins x86_64
8.4.3-1.el9 mysql-8.4-lts-community 1.5 M
mysql-community-common x86_64
8.4.3-1.el9 mysql-8.4-lts-community 575 k
mysql-community-icu-data-files x86_64
8.4.3-1.el9 mysql-8.4-lts-community 2.3 M
mysql-community-libs x86_64
8.4.3-1.el9 mysql-8.4-lts-community 1.5 M
Transaction Summary
============================================================================
=====================================================================
Install 6 Packages
Total download size: 59 M
Installed size: 330 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): mysql-community-common-8.4.3-1.el9.x86_64.rpm
1.8 MB/s | 575 kB 00:00
(2/6): mysql-community-client-plugins-8.4.3-1.el9.x86_64.rpm
3.8 MB/s | 1.5 MB 00:00
(3/6): mysql-community-icu-data-files-8.4.3-1.el9.x86_64.rpm
13 MB/s | 2.3 MB 00:00
(4/6): mysql-community-libs-8.4.3-1.el9.x86_64.rpm
12 MB/s | 1.5 MB 00:00
(5/6): mysql-community-client-8.4.3-1.el9.x86_64.rpm
5.3 MB/s | 3.1 MB 00:00
(6/6): mysql-community-server-8.4.3-1.el9.x86_64.rpm
29 MB/s | 50 MB 00:01
----------------------------------------------------------------------------
---------------------------------------------------------------------Total
27 MB/s | 59 MB 00:02
MySQL 8.4 LTS Community Server
3.0 MB/s | 3.1 kB 00:00
Importing GPG key 0xA8D3785C:
Userid : "MySQL Release Engineering <mysql-build@oss.oracle.com>"
Fingerprint: BCA4 3417 C3B4 85DD 128E C6D4 B7B3 B788 A8D3 785C
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2023
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing :
1/1
Installing : mysql-community-common-8.4.3-1.el9.x86_64
1/6
Installing : mysql-community-client-plugins-8.4.3-1.el9.x86_64
2/6
Installing : mysql-community-libs-8.4.3-1.el9.x86_64
3/6
Running scriptlet: mysql-community-libs-8.4.3-1.el9.x86_64
3/6
Installing : mysql-community-client-8.4.3-1.el9.x86_64
4/6
Installing : mysql-community-icu-data-files-8.4.3-1.el9.x86_64
5/6
Running scriptlet: mysql-community-server-8.4.3-1.el9.x86_64
6/6
Installing : mysql-community-server-8.4.3-1.el9.x86_64
6/6
Running scriptlet: mysql-community-server-8.4.3-1.el9.x86_64
6/6
Verifying : mysql-community-client-8.4.3-1.el9.x86_64
1/6
Verifying : mysql-community-client-plugins-8.4.3-1.el9.x86_64
2/6
Verifying : mysql-community-common-8.4.3-1.el9.x86_64
3/6
Verifying : mysql-community-icu-data-files-8.4.3-1.el9.x86_64
4/6
Verifying : mysql-community-libs-8.4.3-1.el9.x86_64
5/6
Verifying : mysql-community-server-8.4.3-1.el9.x86_64
6/6
Installed products updated.
Installed:
mysql-community-client-8.4.3-1.el9.x86_64 mysql-community-clientplugins-8.4.3-1.el9.x86_64 mysql-community-common-8.4.3-1.el9.x86_64
mysql-community-icu-data-files-8.4.3-1.el9.x86_64 mysql-community-libs-
8.4.3-1.el9.x86_64 mysql-community-server-8.4.3-1.el9.x86_64
Complete!

 删除清理

[root@MySQL ~]# dnf remove mysql-server -y
[root@MySQL ~]# rm -rf /var/lib/mysql
[root@MySQL ~]# rm -rf /var/log/mysqld.log
[root@MySQL ~]# userdel -r mysql
userdel: mysql mail spool (/var/spool/mail/mysql) not found
userdel: mysql home directory (/var/lib/mysql) not found

第二种方法 :二进制本地

 在上面的页面中点击【MySQL Community Server】链接进入下载页面,在列表选项中选择对应的选 项,我们这里选择如下选项。

 单击第一项【RPM Bundle】条目后的【Download】按钮进入本地安装下载确认页面。

在确认页面中,点击确认链接进行下载,浏览器会自动下载该安装包,在下载完成后,可以将该安装包 传送到Linux 操作系统中。
也可以通过该链接直接在 Linux 操作系统中使用 wget 命令进行下载。
[root@MySQL ~]# wget https://cdn.mysql.com//Downloads/MySQL-8.4/mysql-8.4.3-
1.el9.x86_64.rpm-bundle.tar

我们使用wget命令直接下载。下载完成后,我们使用以下命令进行解压。

[root@MySQL ~]# tar xf mysql-8.4.3-1.el9.x86_64.rpm-bundle.tar

开始安装

dnf localinstall mysql-community-server-8.4.3-1.el9.x86_64.rpm

 

[root@MySQL ~]# dnf localinstall mysql-community-server-8.4.3-1.el9.x86_64.rpm
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use "rhc"
or "subscription-manager" to register.
Last metadata expiration check: 0:04:32 ago on Mon 30 Dec 2024 12:46:44 PM
CST.
Dependencies resolved.
============================================================================
=====================================================================
Package Architecture
Version Repository Size
============================================================================
=====================================================================
Installing:
mysql-community-server x86_64
8.4.3-1.el9 @commandline 50 M
Installing dependencies:
mysql-community-client x86_64
8.4.3-1.el9 mysql-8.4-lts-community 3.1 M
mysql-community-client-plugins x86_64
8.4.3-1.el9 mysql-8.4-lts-community 1.5 M
mysql-community-common x86_64
8.4.3-1.el9 mysql-8.4-lts-community 575 k
mysql-community-icu-data-files x86_64
8.4.3-1.el9 mysql-8.4-lts-community 2.3 M
mysql-community-libs x86_64
8.4.3-1.el9 mysql-8.4-lts-community 1.5 M
Transaction Summary
============================================================================
=====================================================================
Install 6 Packages
Total size: 59 M
Total download size: 8.9 M
Installed size: 330 M
Is this ok [y/N]: y
Downloading Packages:
(1/5): mysql-community-common-8.4.3-1.el9.x86_64.rpm
1.6 MB/s | 575 kB 00:00
(2/5): mysql-community-client-plugins-8.4.3-1.el9.x86_64.rpm
4.0 MB/s | 1.5 MB 00:00
(3/5): mysql-community-client-8.4.3-1.el9.x86_64.rpm
6.2 MB/s | 3.1 MB 00:00
(4/5): mysql-community-libs-8.4.3-1.el9.x86_64.rpm
11 MB/s | 1.5 MB 00:00
(5/5): mysql-community-icu-data-files-8.4.3-1.el9.x86_64.rpm
9.6 MB/s | 2.3 MB 00:00----------------------------------------------------------------------------
---------------------------------------------------------------------
Total
15 MB/s | 8.9 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing :
1/1
Installing : mysql-community-common-8.4.3-1.el9.x86_64
1/6
Installing : mysql-community-client-plugins-8.4.3-1.el9.x86_64
2/6
Installing : mysql-community-libs-8.4.3-1.el9.x86_64
3/6
Running scriptlet: mysql-community-libs-8.4.3-1.el9.x86_64
3/6
Installing : mysql-community-client-8.4.3-1.el9.x86_64
4/6
Installing : mysql-community-icu-data-files-8.4.3-1.el9.x86_64
5/6
Running scriptlet: mysql-community-server-8.4.3-1.el9.x86_64
6/6
Installing : mysql-community-server-8.4.3-1.el9.x86_64
6/6
Running scriptlet: mysql-community-server-8.4.3-1.el9.x86_64
6/6
Verifying : mysql-community-client-8.4.3-1.el9.x86_64
1/6
Verifying : mysql-community-client-plugins-8.4.3-1.el9.x86_64
2/6
Verifying : mysql-community-common-8.4.3-1.el9.x86_64
3/6
Verifying : mysql-community-icu-data-files-8.4.3-1.el9.x86_64
4/6
Verifying : mysql-community-libs-8.4.3-1.el9.x86_64
5/6
Verifying : mysql-community-server-8.4.3-1.el9.x86_64
6/6
Installed products updated.
Installed:
mysql-community-client-8.4.3-1.el9.x86_64 mysql-community-clientplugins-8.4.3-1.el9.x86_64 mysql-community-common-8.4.3-1.el9.x86_64
mysql-community-icu-data-files-8.4.3-1.el9.x86_64 mysql-community-libs-
8.4.3-1.el9.x86_64 mysql-community-server-8.4.3-1.el9.x86_64
Complete!

至此安装完成。

删除清理 

[root@MySQL ~]# dnf remove mysql-server -y
[root@MySQL ~]# rm -rf /var/lib/mysql
[root@MySQL ~]# rm -rf /var/log/mysqld.log
[root@MySQL ~]# userdel -r mysql
userdel: mysql mail spool (/var/spool/mail/mysql) not found
userdel: mysql home directory (/var/lib/mysql) not found

第三种方法:容器平台 

删除之前的容器安装

[root@MySQL ~]# dnf remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine \
podman \
runc

配置容易软件仓库

dnf -y install dnf-plugins-corednf repolist

 

[root@MySQL ~]# dnf -y install dnf-plugins-core
dnf config-manager --add-repo https://download.docker.com/linux/rhel/dockerce.repo
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use "rhc"
or "subscription-manager" to register.
Last metadata expiration check: 2:23:14 ago on Mon 30 Dec 2024 12:46:44 PM
CST.
Package dnf-plugins-core-4.3.0-16.el9.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use "rhc"
or "subscription-manager" to register.
Adding repo from: https://download.docker.com/linux/rhel/docker-ce.repo
[root@MySQL ~]# dnf repolist
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use "rhc"
or "subscription-manager" to register.repo id repo
name
appstream
appstream
baseos
baseos
docker-ce-stable
Docker CE Stable - x86_64
mysql-8.4-lts-community
MySQL 8.4 LTS Community Server
mysql-connectors-community
MySQL Connectors Community
mysql-tools-8.4-lts-community
MySQL Tools 8.4 LTS Community

 安装Docker相关软件

dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin 
docker-compose-plugin
[root@MySQL ~]# dnf install docker-ce docker-ce-cli containerd.io dockerbuildx-plugin docker-compose-plugin
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use "rhc"
or "subscription-manager" to register.
Last metadata expiration check: 0:19:43 ago on Mon 30 Dec 2024 03:11:17 PM
CST.
Dependencies resolved.
============================================================================
=====================================================================
Package Architecture
Version Repository Size
============================================================================
=====================================================================
Installing:
containerd.io x86_64
1.7.24-3.1.el9 docker-ce-stable 43 M
docker-buildx-plugin x86_64
0.19.3-1.el9 docker-ce-stable 14 M
docker-ce x86_64
3:27.4.1-1.el9 docker-ce-stable 27 M
docker-ce-cli x86_64
1:27.4.1-1.el9 docker-ce-stable 8.0 M
docker-compose-plugin x86_64
2.32.1-1.el9 docker-ce-stable 14 M
Installing dependencies:
container-selinux noarch
3:2.232.1-1.el9 appstream 60 k
fuse-overlayfs x86_64 1.14-
1.el9 appstream 69 k
libslirp x86_64 4.4.0-
8.el9 appstream 70 k
slirp4netns x86_64 1.3.1-
1.el9 appstream 49 k
Installing weak dependencies:docker-ce-rootless-extras x86_64
27.4.1-1.el9 docker-ce-stable 4.4 M
Transaction Summary
============================================================================
=====================================================================
Install 10 Packages
Total size: 110 M
Installed size: 430 M
Is this ok [y/N]: y
Downloading Packages:
[SKIPPED] containerd.io-1.7.24-3.1.el9.x86_64.rpm: Already downloaded
[SKIPPED] docker-buildx-plugin-0.19.3-1.el9.x86_64.rpm: Already downloaded
[SKIPPED] docker-ce-27.4.1-1.el9.x86_64.rpm: Already downloaded
[SKIPPED] docker-ce-cli-27.4.1-1.el9.x86_64.rpm: Already downloaded
[SKIPPED] docker-ce-rootless-extras-27.4.1-1.el9.x86_64.rpm: Already
downloaded
[SKIPPED] docker-compose-plugin-2.32.1-1.el9.x86_64.rpm: Already downloaded
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing :
1/1
Running scriptlet: container-selinux-3:2.232.1-1.el9.noarch
1/10
Installing : container-selinux-3:2.232.1-1.el9.noarch
1/10
Running scriptlet: container-selinux-3:2.232.1-1.el9.noarch
1/10
Installing : docker-compose-plugin-2.32.1-1.el9.x86_64
2/10
Running scriptlet: docker-compose-plugin-2.32.1-1.el9.x86_64
2/10
Installing : containerd.io-1.7.24-3.1.el9.x86_64
3/10
Running scriptlet: containerd.io-1.7.24-3.1.el9.x86_64
3/10
Installing : libslirp-4.4.0-8.el9.x86_64
4/10
Installing : slirp4netns-1.3.1-1.el9.x86_64
5/10
Installing : fuse-overlayfs-1.14-1.el9.x86_64
6/10
Running scriptlet: fuse-overlayfs-1.14-1.el9.x86_64
6/10
Installing : docker-buildx-plugin-0.19.3-1.el9.x86_64
7/10Running scriptlet: docker-buildx-plugin-0.19.3-1.el9.x86_64
7/10
Installing : docker-ce-cli-1:27.4.1-1.el9.x86_64
8/10
Running scriptlet: docker-ce-cli-1:27.4.1-1.el9.x86_64
8/10
Installing : docker-ce-rootless-extras-27.4.1-1.el9.x86_64
9/10
Running scriptlet: docker-ce-rootless-extras-27.4.1-1.el9.x86_64
9/10
Installing : docker-ce-3:27.4.1-1.el9.x86_64
10/10
Running scriptlet: docker-ce-3:27.4.1-1.el9.x86_64
10/10
Running scriptlet: container-selinux-3:2.232.1-1.el9.noarch
10/10
Running scriptlet: docker-ce-3:27.4.1-1.el9.x86_64
10/10
Verifying : containerd.io-1.7.24-3.1.el9.x86_64
1/10
Verifying : docker-buildx-plugin-0.19.3-1.el9.x86_64
2/10
Verifying : docker-ce-3:27.4.1-1.el9.x86_64
3/10
Verifying : docker-ce-cli-1:27.4.1-1.el9.x86_64
4/10
Verifying : docker-ce-rootless-extras-27.4.1-1.el9.x86_64
5/10
Verifying : docker-compose-plugin-2.32.1-1.el9.x86_64
6/10
Verifying : container-selinux-3:2.232.1-1.el9.noarch
7/10
Verifying : fuse-overlayfs-1.14-1.el9.x86_64
8/10
Verifying : libslirp-4.4.0-8.el9.x86_64
9/10
Verifying : slirp4netns-1.3.1-1.el9.x86_64
10/10
Installed products updated.
Installed:
container-selinux-3:2.232.1-1.el9.noarch containerd.io-1.7.24-
3.1.el9.x86_64 docker-buildx-plugin-0.19.3-1.el9.x86_64
docker-ce-3:27.4.1-1.el9.x86_64 docker-ce-cli-1:27.4.1-
1.el9.x86_64 docker-ce-rootless-extras-27.4.1-1.el9.x86_64
docker-compose-plugin-2.32.1-1.el9.x86_64 fuse-overlayfs-1.14-
1.el9.x86_64 libslirp-4.4.0-8.el9.x86_64
slirp4netns-1.3.1-1.el9.x86_64
Complete!

 启动Docker服务

systemctl enable --now docker

 

拉取MySQL镜像

docker search mysqldocker pull mysql:8.4.3docker images
[root@MySQL ~]# docker search mysql
NAME DESCRIPTION STARS
OFFICIAL
mysql MySQL is a widely used, open-source relation… 15562
[OK]
bitnami/mysql Bitnami container image for MySQL 122
circleci/mysql MySQL is a widely used, open-source relation… 30
cimg/mysql 3
bitnamicharts/mysql Bitnami Helm chart for MySQL 0
ubuntu/mysql MySQL open source fast, stable, multi-thread… 66
rapidfort/mysql RapidFort optimized, hardened image for MySQL 26
elestio/mysql Mysql, verified and packaged by Elestio 1
google/mysql MySQL server for Google Compute Engine 25
docksal/mysql MySQL service images for Docksal - https://d… 0
alpine/mysql mysql client 3
mysql/mysql-server Optimized MySQL Server Docker images. Create… 1024
jumpserver/mysql 1
datajoint/mysql MySQL image pre-configured to work smoothly … 2
ddev/mysql ARM64 base images for ddev-dbserver-mysql-8.… 1
mysql/mysql-router MySQL Router provides transparent routing be… 28
mirantis/mysql 0
ilios/mysql Mysql configured for running Ilios 1
corpusops/mysql https://github.com/corpusops/docker-images/ 0
mysql/mysql-cluster Experimental MySQL Cluster Docker images. Cr… 100
javanile/mysql MySQL for development 0
vulhub/mysql 1
mysql/mysql-operator MySQL Operator for Kubernetes 1vitess/mysql Lightweight image to run MySQL with Vitess 1
nasqueron/mysql 1
[root@MySQL ~]# docker pull mysql:8.4.3
8.4.3: Pulling from library/mysql
2c0a233485c3: Pull complete
6f5cca38a221: Pull complete
d7c84b66ede0: Pull complete
299f6f88c6cf: Pull complete
d39eae8f9927: Pull complete
ec0557361569: Pull complete
f6d0f80cb1be: Pull complete
d496030b710c: Pull complete
4d755d8c89d1: Pull complete
699d8e3dc44b: Pull complete
Digest:
sha256:106d5197fd8e4892980469ad42eb20f7a336bd81509aae4ee175d852f5cc4565
Status: Downloaded newer image for mysql:8.4.3
docker.io/library/mysql:8.4.3
[root@MySQL ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mysql 8.4.3 3818a28b4a67 2 months ago 594MB

启动容器

docker run --name mysqltest -e MYSQL_ROOT_PASSWORD=123456 -d
mysql:8.4.3

 

查看并测试

docker ps

 

删除清理 

[root@MySQL ~]# docker stop mysqltest
mysqltest
[root@MySQL ~]# docker rm mysqltest
mysqltest
[root@MySQL ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

如果无法正常使用docker镜像仓库 

### 导出镜像
[root@MySQL ~]# docker save -o MySQL843.tar mysql:8.4.3
### 导入镜像
[root@MySQL ~]# docker load -i MySQL843.tar
7600fdef234b: Loading layer
[==================================================>] 116.5MB/116.5MB
e17cefd60af0: Loading layer
[==================================================>] 11.26kB/11.26kB
1fa6f54b3274: Loading layer
[==================================================>] 2.359MB/2.359MB
af5010f21ea7: Loading layer
[==================================================>] 17.18MB/17.18MB
abee1c5192d7: Loading layer
[==================================================>] 6.656kB/6.656kB
0576c12e071e: Loading layer
[==================================================>] 3.072kB/3.072kB
66e0995dbcea: Loading layer
[==================================================>] 140.6MB/140.6MB
06bb0f112933: Loading layer
[==================================================>] 3.072kB/3.072kB
793b5c3cdf77: Loading layer
[==================================================>] 335.2MB/335.2MB
099ca8e33f5e: Loading layer
[==================================================>] 17.41kB/17.41kB
Loaded image: mysql:8.4.3

第四种方法:源码部署 

在下载页面点击【 MySQL Community(GPL) Downloads 】链接进入社区版下载页面,我们选择合适的 版本和选项。

 

 点击【Download】按钮进入到下载确认页面,点击连接继续下载

 也可以使用该连接,在Linux操作系统中直接使用wget进行下载

[root@MySQL ~]# wget https://cdn.mysql.com//Downloads/MySQL-8.4/mysql-8.4.3.tar.gz
Linux 中下载时,如果不指定目录,则在保存在当前目录。
清理之前的环境:
[root@MySQL ~]# dnf remove mysql-server -y 
[root@MySQL ~]# rm -rf /var/lib/mysql
[root@MySQL ~]# rm -rf /var/log/mysqld.log
[root@MySQL ~]# userdel -r mysql

我们在根目录中创建mysql目录,方便操作

 

使用命令解压源码包

 

创建用户 ,修改目录权限

安装需要的软件:

[root@MySQL bld]# dnf install cmake openssl-devel ncurses-devel rpcgen gcc-toolset-12-gcc gcc-toolset-12-gcc-c++ gcc-toolset-12-binutils gcc-toolset-12-
annobin-annocheck gcc-toolset-12-annobin-plugin-gcc[root@MySQL bld]# rpm -i
https://yum.oracle.com/repo/OracleLinux/OL9/codeready/builder/x86_64/getPackag
e/libtirpc-devel-1.3.3-9.el9.x86_64.rpm
warning: /var/tmp/rpm-tmp.KJQV1s: Header V3 RSA/SHA256 Signature, key ID
8d8b756f: NOKEY

配置并编译

[root@MySQL bld]# cmake ..
[root@MySQL bld]# make
[root@MySQL bld]# make install
[root@MySQL bld]# cd /usr/local/mysql
[root@MySQL mysql]# mkdir mysql-files
[root@MySQL mysql]# chown mysql:mysql mysql-files
[root@MySQL mysql]# chmod 750 mysql-files
[root@MySQL mysql]# bin/mysqld --initialize --user=mysql

 

登录测试 

清理删除 

[root@MySQL bld]# make clean
[root@MySQL bld]# rm -rf /usr/local/mysql/

二. Windows平台

第五种方法:服务端安装

在下载页面点击【 MySQL Community(GPL) Downloads 】链接进入社区版下载页面,我们选择合适的版本和选项。

 

 点击【Download】按钮j进入到下载确认页面,单击确认链接直接下载。

下载完成,双击执行该可执行程序,打开欢迎页面,单击【 Next 】按钮进入下一步。

 

进入到用户协议页面,选中复选框,单击【 Next 】按钮,进入下一步

 

进入安装类型选择页面,我们这里选择第一个【 Typical 】,选中后直接进行下一页。
进入准备页面,我们单击【 Install 】按钮进行安装。
经过一段时间的安装,安装完成后,显示如下页面,默认选中【 Run MySQL Configurator 】按钮,单击 【Finish 】按钮进行配置。
进入配置页面,单击【 Next 】按钮进入下一步。
进入选择数据目录页面,这里我们保持默认,单击【 Next 】按钮进入下一步。
进入配置类型和网络配置页面,我们这里保持默认,单击【 Next 】按钮进入下一步。
在账号和角色页面,我们输入 root 账号的密码并确认密码,默认不添加新账号,单击【 Next 】下一步。
进入服务配置页面,这里我们保持默认,单击【 Next 】按钮进入下一步。
进入服务权限页面,我们这里保持默认,单击【 Next 】按钮进入下一步。
配置示例数据库是否要载入,选中即为载入,我们这里选择载入,单击【 Next 】进行下一步。
进入配置摘要页面,单击【 Execute 】按钮执行配置。
这里显示配置完成的页面,单击【 Finish 】按钮完成配置。

命令行测试

连接测试:我们将命令行工具固定到任务栏,也可以创建快捷方式到桌面,使用起来很方便。
mysql> select version();
+-----------+
| version() |
+-----------+
| 8.4.3 |
+-----------+
1 row in set (0.00 sec)mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sakila |
| sys |
| world |
+--------------------+
6 rows in set (0.02 sec)
mysql>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/502965.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

极客说|微软 Phi 系列小模型和多模态小模型

作者&#xff1a;胡平 - 微软云人工智能高级专家 「极客说」 是一档专注 AI 时代开发者分享的专栏&#xff0c;我们邀请来自微软以及技术社区专家&#xff0c;带来最前沿的技术干货与实践经验。在这里&#xff0c;您将看到深度教程、最佳实践和创新解决方案。关注「极客说」&am…

封装/前线修饰符/Idea项目结构/package/impore

目录 1. 封装的情景引入 2. 封装的体现 3. 权限修饰符 4. Idea 项目结构 5. package 关键字 6. import 关键字 7. 练习 程序设计&#xff1a;高内聚&#xff0c;低耦合&#xff1b; 高内聚&#xff1a;将类的内部操作“隐藏”起来&#xff0c;不需要外界干涉&#xff1b…

【C++】P5733 【深基6.例1】自动修正

博客主页&#xff1a; [小ᶻ☡꙳ᵃⁱᵍᶜ꙳] 本文专栏: C 文章目录 &#x1f4af;前言&#x1f4af;题目描述&#x1f4af;解题思路概述&#x1f4af;第一种实现方式&#xff1a;直接使用字符ASCII值计算代码实现代码分析 &#x1f4af;第二种实现方式&#xff1a;直接修改…

【Elasticsearch】文档操作:添加、更新和删除

&#x1f9d1; 博主简介&#xff1a;CSDN博客专家&#xff0c;历代文学网&#xff08;PC端可以访问&#xff1a;https://literature.sinhy.com/#/?__c1000&#xff0c;移动端可微信小程序搜索“历代文学”&#xff09;总架构师&#xff0c;15年工作经验&#xff0c;精通Java编…

【insert 插入数据语法合集】.NET开源ORM框架 SqlSugar 系列

系列文章目录 &#x1f380;&#x1f380;&#x1f380; .NET开源 ORM 框架 SqlSugar 系列 &#x1f380;&#x1f380;&#x1f380; 文章目录 系列文章目录一、前言 &#x1f343;二、插入方式 &#x1f4af;2.1 单条插入实体2.2 批量 插入实体2.3 根据字典插入2.4 根据 Dat…

权限掩码umask

1 、 设置新建文件或目录的默认权限 在 Linux 系统中&#xff0c;当用户创建一个新的文件或目录时&#xff0c;系统都会为新建的文件或目录分配默认的权限&#xff0c;该默认权限与umask 值有关&#xff0c;其具体关系是&#xff1a; 新建文件的默认权限 0666-umask 值 新建…

202-01-06 Unity 使用 Tip1 —— UnityHub 模块卸载重装

文章目录 1 卸载模块2 更新配置文件3 重启 UnityHub 起因&#xff1a; ​ WebGL 平台打包程序报错&#xff0c;懒得修复了&#xff0c;因此粗暴地删了重装。但是 UnityHub 不支持卸载模块&#xff0c;因此手动配置。 1 卸载模块 ​ 以 Unity 6000.0.26f1c1 为例&#xff0c;其…

打造三甲医院人工智能矩阵新引擎(二):医学影像大模型篇--“火眼金睛”TransUNet

一、引言 1.1 研究背景与意义 在现代医疗领域,医学影像作为疾病诊断与治疗的关键依据,发挥着不可替代的作用。从传统的X射线、CT(计算机断层扫描)到MRI(磁共振成像)等先进技术,医学影像能够直观呈现人体内部结构,为医生提供丰富的诊断信息,涵盖疾病识别、病灶定位、…

国产编辑器EverEdit - 两种删除空白行的方法

1 使用技巧&#xff1a;删除空白行 1.1 应用场景 用户在编辑文档时&#xff0c;可能会遇到很多空白行需要删除的情况&#xff0c;比如从网页上拷贝文字&#xff0c;可能就会存在大量的空白行要删除。 1.2 使用方法 1.2.1 方法1&#xff1a; 使用编辑主菜单 选择主菜单编辑 …

李宏毅机器学习笔记-Transformer

目录 1. Seq2seq 2. encoder Transformer 中的 Block 结构 3. Decoder 4.Encoder和Decoder间的信息传递 5.Training 6.Tips 1. Seq2seq Transformer 是一个seq2seq的model。Seq2seq指的是input是一个序列&#xff0c;输出也是一个序列&#xff0c;输出的长度是由机器自己…

GitLab集成Runner详细版--及注意事项汇总【最佳实践】

一、背景 看到网上很多用户提出的runner问题其实实际都不是问题&#xff0c;不过是因为对runner的一些细节不清楚导致了误解。本文不系统性的介绍GitLab-Runner&#xff0c;因为这类文章写得好的特别多&#xff0c;本文只汇总一些常几的问题/注意事项。旨在让新手少弯路。 二、…

指针 const 的组合

1、首先来了解一下常量 const int num 5&#xff1b; 那么num的值是5&#xff0c; num的值不可修改 2、来了解一下指针 int value 5; int* p &value; 我喜欢吧指针和类型放一起&#xff0c;来强调p是一个指针类型&#xff0c; 而赋值的时候就得赋值一个int类型的地址…

《C++11》各种初始化方式的详细列举与对比

在 C 中&#xff0c;初始化对象的方式多种多样。随着 C 标准的演进&#xff0c;特别是 C11 的引入&#xff0c;初始化方式得到了显著的扩展和改进。本文将详细列举 C 中的各种初始化方式&#xff0c;并对它们进行对比&#xff0c;帮助开发者更好地理解和应用这些特性。 1. C98…

前端小案例——520表白信封

前言&#xff1a;我们在学习完了HTML和CSS之后&#xff0c;就会想着使用这两个东西去做一些小案例&#xff0c;不过又没有什么好的案例让我们去练手&#xff0c;本篇文章就提供里一个案例——520表白信封 ✨✨✨这里是秋刀鱼不做梦的BLOG ✨✨✨想要了解更多内容可以访问我的主…

【Vim Masterclass 笔记05】第 4 章:Vim 的帮助系统与同步练习(L14+L15+L16)

文章目录 Section 4&#xff1a;The Vim Help System&#xff08;Vim 帮助系统&#xff09;S04L14 Getting Help1 打开帮助系统2 退出帮助系统3 查看具体命令的帮助文档4 查看帮助文档中的主题5 帮助文档间的上翻、下翻6 关于 linewise7 查看光标所在术语名词的帮助文档8 关于退…

10-C语言项目池

C语言项目池 《个人通讯录》 《火车订票系统》 管理员用户1录入火车票信息区间查询/购票2显示火车票信息打印购票信息3查询火车票信息退票4修改火车票信息5添加火车票信息 《学生学籍管理系统》 1录入学生信息2添加学生信息3显示学生信息4查找学生信息5删除学生信息6修改学…

Android 绘制学习总结

1、刷新率介绍 我们先来理一下基本的概念&#xff1a; 1、60 fps 的意思是说&#xff0c;画面每秒更新 60 次 2、这 60 次更新&#xff0c;是要均匀更新的&#xff0c;不是说一会快&#xff0c;一会慢&#xff0c;那样视觉上也会觉得不流畅 3、每秒 60 次&#xff0c;也就是 1…

每日一题:BM1 反转链表

文章目录 [toc]问题描述数据范围示例 C代码实现使用栈实现&#xff08;不符合要求&#xff0c;仅作为思路&#xff09; 解题思路 - 原地反转链表步骤 C语言代码实现 以前只用过C刷过代码题目&#xff0c;现在试着用C语言刷下 问题描述 给定一个单链表的头结点 pHead&#xff…

78、使用爱芯派2_AX630C开发板 3.2T高有效算力 低功耗 支持AI-ISP真黑光实验

基本思想:使用爱心元智最新的版本开发板进行实验 AX630C、AX620Q 都是 620E 这一代 一、参考这个官方教程,先把代码在本地交叉编译完成 https://github.com/AXERA-TECH/ax620e_bsp_sdk 然后在拷贝到620c设备上 root@ax630c:~/ax620e_bsp_sdk/msp/out/arm64_glibc/bin# ./…

【Redis经典面试题七】Redis的事务机制是怎样的?

目录 一、Redis的事务机制 二、什么是Redis的Pipeline&#xff1f;和事务有什么区别&#xff1f; 三、Redis的事务和Lua之间有哪些区别&#xff1f; 3.1 原子性保证 3.2 交互次数 3.3 前后依赖 3.4 流程编排 四、为什么Lua脚本可以保证原子性&#xff1f; 五、为什么R…