How to install MySQL 8.4 on Ubuntu 24.04 Using the MySQL APT Repository

2024年 6月 30日 76.5k 0

##

How to install MySQL 8.4 on Ubuntu 24.04 Using the MySQL APT Repository

1、Download APT Repository

link: https://dev.mysql.com/downloads/repo/apt/

filename: mysql-apt-config_0.8.30-1_all.deb

upload this file to Ubuntu 24.04

2、Install MySQL 8.4

root@demo:~# dpkg -i mysql-apt-config_0.8.30-1_all.deb
(Reading database ... 83352 files and directories currently installed.)
Preparing to unpack mysql-apt-config_0.8.30-1_all.deb ...
Unpacking mysql-apt-config (0.8.30-1) over (0.8.30-1) ...
Setting up mysql-apt-config (0.8.30-1) ...

root@demo:~# apt-get update
Hit:1 https://mirrors.aliyun.com/ubuntu noble InRelease
Hit:2 https://mirrors.aliyun.com/ubuntu noble-updates InRelease
Hit:3 http://security.ubuntu.com/ubuntu noble-security InRelease
Hit:4 https://mirrors.aliyun.com/ubuntu noble-backports InRelease
Get:5 http://repo.mysql.com/apt/ubuntu noble InRelease [22.6 kB]
Get:6 http://repo.mysql.com/apt/ubuntu noble/mysql-8.4-lts amd64 Packages [16.8 kB]
Get:7 http://repo.mysql.com/apt/ubuntu noble/mysql-tools amd64 Packages [4,125 B]
Fetched 43.6 kB in 7s (5,999 B/s)
Reading package lists... Done

root@demo:~# apt-get install mysql-server

#input password

If you want to install other major release series,

root@demo:~# dpkg-reconfigure mysql-apt-config
root@demo:~# apt-get update

3、Check

root@demo:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04 LTS
Release: 24.04
Codename: noble

root@demo:~# mysql --version
mysql Ver 8.4.0 for Linux on x86_64 (MySQL Community Server - GPL)
root@demo:~#

root@demo:~# dpkg -l | grep mysql
ii mysql-apt-config 0.8.30-1 all Auto configuration for MySQL APT Repo.
ii mysql-client 8.4.0-1ubuntu24.04 amd64 MySQL Client meta package depending on latest version
ii mysql-common 8.4.0-1ubuntu24.04 amd64 Common files shared between packages
ii mysql-community-client 8.4.0-1ubuntu24.04 amd64 MySQL Client
ii mysql-community-client-core 8.4.0-1ubuntu24.04 amd64 MySQL Client Core Binaries
ii mysql-community-client-plugins 8.4.0-1ubuntu24.04 amd64 MySQL Client plugin
ii mysql-community-server 8.4.0-1ubuntu24.04 amd64 MySQL Server
ii mysql-community-server-core 8.4.0-1ubuntu24.04 amd64 MySQL Server Core Binaires
ii mysql-server 8.4.0-1ubuntu24.04 amd64 MySQL Server meta package depending on latest version

root@demo:~# systemctl status mysql
● mysql.service - MySQL Community Server
Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled; preset: enabled)
Active: active (running) since Sun 2024-06-30 08:24:32 UTC; 10s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Main PID: 3070 (mysqld)
Status: "Server is operational"
Tasks: 36 (limit: 9387)
Memory: 431.2M (peak: 444.9M)
CPU: 1.457s
CGroup: /system.slice/mysql.service
└─3070 /usr/sbin/mysqld

Jun 30 08:24:30 demo systemd[1]: Starting mysql.service - MySQL Community Server...
Jun 30 08:24:32 demo systemd[1]: Started mysql.service - MySQL Community Server.

root@demo:~# mysql -uroot -proot
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 10
Server version: 8.4.0 MySQL Community Server - GPL

Copyright (c) 2000, 2024, 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> \q
Bye

4、Install mysql-shell

root@demo:~# apt-get install mysql-shell

5、uninstall mysql

root@demo:~# apt-get remove mysql-server
root@demo:~# apt-get autoremove

root@demo:~# rm -fr /var/lib/mysql
root@demo:~# rm -fr /var/log/mysql

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论