arch->mariadb安装

本文详细介绍了如何使用sudo pacman安装MariaDB,并通过sudo mariadb-install-db进行数据库初始化。特别强调了首次安装时的重要步骤,包括如何处理以前的安装残留,如删除/var/lib/mysql目录,启动MariaDB服务以及进行安全配置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

sudo pacman -S mariadb
sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

如果是以前安装过, 就要看一下删除datadir的远程目录 , 也就是/var/lib/mysql

systemctl start mariadb
mysql_secure_installation

第一次安装就可以一直y下去

转载于:https://www.cnblogs.com/instinct-em/p/11135214.html

rpm -e --nodeps mariadb-libs mariadb-server mariadb-client 2>/dev/null [root@VM-12-8-centos ~]# yum remove -y mysql mysql-server Loaded plugins: fastestmirror, langpacks No Match for argument: mysql No Match for argument: mysql-server No Packages marked for removal [root@VM-12-8-centos ~]# rm -rf /var/lib/mysql /etc/my.cnf [root@VM-12-8-centos ~]# rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-7.noarch.rpm Retrieving https://dev.mysql.com/get/mysql80-community-release-el7-7.noarch.rpm Preparing... ################################# [100%] package mysql80-community-release-el7-7.noarch is already installed [root@VM-12-8-centos ~]# yum install -y mysql-community-server Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile Resolving Dependencies --> Running transaction check ---> Package mysql-community-server.x86_64 0:8.0.42-1.el7 will be installed --> Processing Dependency: mysql-community-common(x86-64) = 8.0.42-1.el7 for package: mysql-community-server-8.0.42-1.el7.x86_64 --> Processing Dependency: mysql-community-icu-data-files = 8.0.42-1.el7 for package: mysql-community-server-8.0.42-1.el7.x86_64 --> Processing Dependency: mysql-community-client(x86-64) >= 8.0.11 for package: mysql-community-server-8.0.42-1.el7.x86_64 --> Running transaction check ---> Package mysql-community-client.x86_64 0:8.0.42-1.el7 will be installed --> Processing Dependency: mysql-community-client-plugins = 8.0.42-1.el7 for package: mysql-community-client-8.0.42-1.el7.x86_64 --> Processing Dependency: mysql-community-libs(x86-64) >= 8.0.11 for package: mysql-community-client-8.0.42-1.el7.x86_64 ---> Package mysql-community-common.x86_64 0:8.0.42-1.el7 will be installed ---> Package mysql-community-icu-data-files.x86_64 0:8.0.42-1.el7 will be installed --> Running transaction check ---> Package mariadb-libs.x86_64 1:5.5.68-1.el7 will be obsoleted --> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-9.el7.x86_64 --> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-9.el7.x86_64 ---> Package mysql-community-client-plugins.x86_64 0:8.0.42-1.el7 will be installed ---> Package mysql-community-libs.x86_64 0:8.0.42-1.el7 will be obsoleting --> Running transaction check ---> Package mysql-community-libs-compat.x86_64 0:8.0.42-1.el7 will be obsoleting --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================================================================================================================================ Package Arch Version Repository Size ================================================================================================================================================================================================================================ Installing: mysql-community-libs x86_64 8.0.42-1.el7 mysql80-community 1.5 M replacing mariadb-libs.x86_64 1:5.5.68-1.el7 mysql-community-libs-compat x86_64 8.0.42-1.el7 mysql80-community 669 k replacing mariadb-libs.x86_64 1:5.5.68-1.el7 mysql-community-server x86_64 8.0.42-1.el7 mysql80-community 65 M Installing for dependencies: mysql-community-client x86_64 8.0.42-1.el7 mysql80-community 16 M mysql-community-client-plugins x86_64 8.0.42-1.el7 mysql80-community 3.5 M mysql-community-common x86_64 8.0.42-1.el7 mysql80-community 665 k mysql-community-icu-data-files x86_64 8.0.42-1.el7 mysql80-community 2.2 M Transaction Summary ================================================================================================================================================================================================================================ Install 3 Packages (+4 Dependent packages) Total size: 89 M Downloading packages: warning: /var/cache/yum/x86_64/7/mysql80-community/packages/mysql-community-libs-8.0.42-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID a8d3785c: NOKEY Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql The GPG keys listed for the "MySQL 8.0 Community Server" repository are already installed but they are not correct for this package. Check that the correct key URLs are configured for this repository. Failing package is: mysql-community-libs-8.0.42-1.el7.x86_64 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022, file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
最新发布
07-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值