yum install mysql-community-server rpm方式安装mysql(社区版)
2022/1/31 2:04:28
本文主要是介绍yum install mysql-community-server rpm方式安装mysql(社区版),对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
查看操作系统版本
[root@fp-web-118 local]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
安装之前需要检查一下机器上是否有mysql.
执行安装命令
[root@fp-web-118 local]# yum install mysql-community-server
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
No package mysql-community-server available.
Error: Nothing to do
安装错误,查看yum 源
查看yum 源
[root@fp-web-118 local]# ll /etc/yum.repos.d/
total 36
-rw-r--r-- 1 root root 2523 Feb 15 2019 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 Dec 9 2015 CentOS-CR.repo
-rw-r--r--. 1 root root 649 Dec 9 2015 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 290 Dec 9 2015 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 630 Dec 9 2015 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 Dec 9 2015 CentOS-Sources.repo
-rw-r--r--. 1 root root 1952 Dec 9 2015 CentOS-Vault.repo
-rw-r--r-- 1 root root 664 Feb 15 2019 epel.repo
-rw-r--r-- 1 root root 401 Feb 15 2016 zabbix.repo
注:由于没有mysql.repo,需要上传mysql.repo yum源
安装sz和rz命令
[root@fp-web-118 yum.repos.d]# yum install lrzsz
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package lrzsz.x86_64 0:0.12.20-36.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================
Installing:
lrzsz x86_64 0.12.20-36.el7 base 78 k
Transaction Summary
============================================================================================================================================
Install 1 Package
Total download size: 78 k
Installed size: 181 k
Is this ok [y/d/N]: ys^Hes
Is this ok [y/d/N]: yes
Downloading packages:
lrzsz-0.12.20-36.el7.x86_64.rpm | 78 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : lrzsz-0.12.20-36.el7.x86_64 1/1
Verifying : lrzsz-0.12.20-36.el7.x86_64 1/1
Installed:
lrzsz.x86_64 0:0.12.20-36.el7
Complete!
利用rz 命令上传yum 源,这个yum源是从其他机器上copy过来的 , 看看上传以后的列表
[root@fp-web-118 yum.repos.d]# ll
total 40
-rw-r--r-- 1 root root 2523 Feb 15 2019 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 Dec 9 2015 CentOS-CR.repo
-rw-r--r--. 1 root root 649 Dec 9 2015 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 290 Dec 9 2015 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 630 Dec 9 2015 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 Dec 9 2015 CentOS-Sources.repo
-rw-r--r--. 1 root root 1952 Dec 9 2015 CentOS-Vault.repo
-rw-r--r-- 1 root root 664 Feb 15 2019 epel.repo
-rw-r--r-- 1 root root 1862 May 16 2018 mysql-community.repo
-rw-r--r-- 1 root root 401 Feb 15 2016 zabbix.repo
重新执行安装mysql rpm命令
[root@fp-web-118 yum.repos.d]# yum install mysql-community-server
Loaded plugins: fastestmirror, langpacks
mysql-connectors-community | 2.6 kB 00:00:00
mysql-tools-community | 2.6 kB 00:00:00
mysql56-community | 2.6 kB 00:00:00
(1/3): mysql-connectors-community/x86_64/primary_db | 76 kB 00:00:00
(2/3): mysql56-community/x86_64/primary_db | 338 kB 00:00:01
(3/3): mysql-tools-community/x86_64/primary_db | 73 kB 00:00:01
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.6.51-2.el6 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.6.51-2.el6 for package: mysql-community-server-5.6.51-2.el6.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.6.10 for package: mysql-community-server-5.6.51-2.el6.x86_64
--> Processing Dependency: perl(DBI) for package: mysql-community-server-5.6.51-2.el6.x86_64
--> Processing Dependency: perl(Data::Dumper) for package: mysql-community-server-5.6.51-2.el6.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.51-2.el6 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.6.10 for package: mysql-community-client-5.6.51-2.el6.x86_64
---> Package mysql-community-common.x86_64 0:5.6.51-2.el6 will be installed
---> Package perl-DBI.x86_64 0:1.627-4.el7 will be installed
--> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-4.el7.x86_64
--> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-4.el7.x86_64
---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed
--> Running transaction check
---> Package mysql-community-libs.x86_64 0:5.6.51-2.el6 will be installed
---> Package perl-PlRPC.noarch 0:0.2020-14.el7 will be installed
--> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Running transaction check
---> Package perl-IO-Compress.noarch 0:2.061-2.el7 will be installed
--> Processing Dependency: perl(Compress::Raw::Zlib) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
--> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
---> Package perl-Net-Daemon.noarch 0:0.48-5.el7 will be installed
--> Running transaction check
---> Package perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed
---> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================
Installing:
mysql-community-server x86_64 5.6.51-2.el6 mysql56-community 62 M
Installing for dependencies:
mysql-community-client x86_64 5.6.51-2.el6 mysql56-community 20 M
mysql-community-common x86_64 5.6.51-2.el6 mysql56-community 340 k
mysql-community-libs x86_64 5.6.51-2.el6 mysql56-community 2.2 M
perl-Compress-Raw-Bzip2 x86_64 2.061-3.el7 base 32 k
perl-Compress-Raw-Zlib x86_64 1:2.061-4.el7 base 57 k
perl-DBI x86_64 1.627-4.el7 base 802 k
perl-Data-Dumper x86_64 2.145-3.el7 base 47 k
perl-IO-Compress noarch 2.061-2.el7 base 260 k
perl-Net-Daemon noarch 0.48-5.el7 base 51 k
perl-PlRPC noarch 0.2020-14.el7 base 36 k
Transaction Summary
============================================================================================================================================
Install 1 Package (+10 Dependent packages)
Total download size: 86 M
Installed size: 355 M
Is this ok [y/d/N]: yes
Downloading packages:
warning: /var/cache/yum/x86_64/7/mysql56-community/packages/mysql-community-common-5.6.51-2.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY47 kB/s | 280 kB 00:09:58 ETA
Public key for mysql-community-common-5.6.51-2.el6.x86_64.rpm is not installed
(1/11): mysql-community-common-5.6.51-2.el6.x86_64.rpm | 340 kB 00:00:01
(2/11): mysql-community-libs-5.6.51-2.el6.x86_64.rpm | 2.2 MB 00:00:02
(3/11): perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm | 32 kB 00:00:00
(4/11): perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm | 57 kB 00:00:00
(5/11): perl-Data-Dumper-2.145-3.el7.x86_64.rpm | 47 kB 00:00:00
(6/11): perl-DBI-1.627-4.el7.x86_64.rpm | 802 kB 00:00:00
(7/11): perl-Net-Daemon-0.48-5.el7.noarch.rpm | 51 kB 00:00:00
(8/11): perl-PlRPC-0.2020-14.el7.noarch.rpm | 36 kB 00:00:00
(9/11): perl-IO-Compress-2.061-2.el7.noarch.rpm | 260 kB 00:00:00
(10/11): mysql-community-client-5.6.51-2.el6.x86_64.rpm | 20 MB 00:00:19
(11/11): mysql-community-server-5.6.51-2.el6.x86_64.rpm | 62 MB 00:00:36
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 2.1 MB/s | 86 MB 00:00:40
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
GPG key retrieval failed: [Errno 14] curl#37 - "Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql"
解决这个问题
gpg key retrieval failed 意思是在/etc/pki/rpm-gpg/中找不到RPM-GPG-KEY-mysql
第一种方案,设置gpgcheck为0,就是不需要检查gpgkey。
# enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/
enabled=1
gpgcheck=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
第二种方案,指定外网gpgkey的值
# enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/
enabled=1
gpgcheck=0 gpgkey=http://springdale.math.ias.edu/data/puias/6/x86_64/os/RPM-GPG-KEY-puias
第三种方案,下载gpgkey
//下载RPM-GPG-KEY-mysql
wget http://repo.mysql.com/RPM-GPG-KEY-mysql -O /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
//MySQL中gpgkey指定路径
# enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
解决出错问题
我们看一下 yum源文件 mysql-community.repo
[root@fp-web-118 yum.repos.d]# vi mysql-community.repo
# Enable to use MySQL 5.5
[mysql55-community]
name=MySQL 5.5 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
# Enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/
enabled=1
gpgcheck=1 ##这里修改为0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
# Enable to use MySQL 5.7
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[mysql80-community]
name=MySQL 8.0 Community Server
baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[mysql-connectors-community]
name=MySQL Connectors Community
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[mysql-tools-community]
name=MySQL Tools Community
baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[mysql-tools-preview]
name=MySQL Tools Preview
baseurl=http://repo.mysql.com/yum/mysql-tools-preview/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[mysql-cluster-7.5-community]
name=MySQL Cluster 7.5 Community
baseurl=http://repo.mysql.com/yum/mysql-cluster-7.5-community/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[mysql-cluster-7.6-community]
name=MySQL Cluster 7.6 Community
baseurl=http://repo.mysql.com/yum/mysql-cluster-7.6-community/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
保存,退出
重新执行 mysql安装命令
[root@fp-web-118 yum.repos.d]# yum install mysql-community-server
Loaded plugins: fastestmirror, langpacks
mysql-connectors-community | 2.6 kB 00:00:00
mysql-tools-community | 2.6 kB 00:00:00
mysql56-community | 2.6 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.6.51-2.el6 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.6.51-2.el6 for package: mysql-community-server-5.6.51-2.el6.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.6.10 for package: mysql-community-server-5.6.51-2.el6.x86_64
--> Processing Dependency: perl(DBI) for package: mysql-community-server-5.6.51-2.el6.x86_64
--> Processing Dependency: perl(Data::Dumper) for package: mysql-community-server-5.6.51-2.el6.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.51-2.el6 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.6.10 for package: mysql-community-client-5.6.51-2.el6.x86_64
---> Package mysql-community-common.x86_64 0:5.6.51-2.el6 will be installed
---> Package perl-DBI.x86_64 0:1.627-4.el7 will be installed
--> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-4.el7.x86_64
--> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-4.el7.x86_64
---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed
--> Running transaction check
---> Package mysql-community-libs.x86_64 0:5.6.51-2.el6 will be installed
---> Package perl-PlRPC.noarch 0:0.2020-14.el7 will be installed
--> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Running transaction check
---> Package perl-IO-Compress.noarch 0:2.061-2.el7 will be installed
--> Processing Dependency: perl(Compress::Raw::Zlib) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
--> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
---> Package perl-Net-Daemon.noarch 0:0.48-5.el7 will be installed
--> Running transaction check
---> Package perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed
---> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================================================================================================
Package Arch Version Repository Size
==========================================================================================================================================
Installing:
mysql-community-server x86_64 5.6.51-2.el6 mysql56-community 62 M
Installing for dependencies:
mysql-community-client x86_64 5.6.51-2.el6 mysql56-community 20 M
mysql-community-common x86_64 5.6.51-2.el6 mysql56-community 340 k
mysql-community-libs x86_64 5.6.51-2.el6 mysql56-community 2.2 M
perl-Compress-Raw-Bzip2 x86_64 2.061-3.el7 base 32 k
perl-Compress-Raw-Zlib x86_64 1:2.061-4.el7 base 57 k
perl-DBI x86_64 1.627-4.el7 base 802 k
perl-Data-Dumper x86_64 2.145-3.el7 base 47 k
perl-IO-Compress noarch 2.061-2.el7 base 260 k
perl-Net-Daemon noarch 0.48-5.el7 base 51 k
perl-PlRPC noarch 0.2020-14.el7 base 36 k
Transaction Summary
========================================================================================================================================
Install 1 Package (+10 Dependent packages)
Total size: 86 M
Installed size: 355 M
Is this ok [y/d/N]: yes
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : mysql-community-common-5.6.51-2.el6.x86_64 1/11
Installing : perl-Data-Dumper-2.145-3.el7.x86_64 2/11
Installing : mysql-community-libs-5.6.51-2.el6.x86_64 3/11
Installing : mysql-community-client-5.6.51-2.el6.x86_64 4/11
Installing : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 5/11
Installing : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 6/11
Installing : perl-IO-Compress-2.061-2.el7.noarch 7/11
Installing : perl-Net-Daemon-0.48-5.el7.noarch 8/11
Installing : perl-PlRPC-0.2020-14.el7.noarch 9/11
Installing : perl-DBI-1.627-4.el7.x86_64 10/11
Installing : mysql-community-server-5.6.51-2.el6.x86_64 11/11
Verifying : perl-Net-Daemon-0.48-5.el7.noarch 1/11
Verifying : perl-Data-Dumper-2.145-3.el7.x86_64 2/11
Verifying : mysql-community-server-5.6.51-2.el6.x86_64 3/11
Verifying : mysql-community-common-5.6.51-2.el6.x86_64 4/11
Verifying : perl-IO-Compress-2.061-2.el7.noarch 5/11
Verifying : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 6/11
Verifying : mysql-community-libs-5.6.51-2.el6.x86_64 7/11
Verifying : mysql-community-client-5.6.51-2.el6.x86_64 8/11
Verifying : perl-DBI-1.627-4.el7.x86_64 9/11
Verifying : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 10/11
Verifying : perl-PlRPC-0.2020-14.el7.noarch 11/11
Installed:
mysql-community-server.x86_64 0:5.6.51-2.el6
Dependency Installed:
mysql-community-client.x86_64 0:5.6.51-2.el6 mysql-community-common.x86_64 0:5.6.51-2.el6 mysql-community-libs.x86_64 0:5.6.51-2.el6 perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7
perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 perl-DBI.x86_64 0:1.627-4.el7 perl-Data-Dumper.x86_64 0:2.145-3.el7 perl-IO-Compress.noarch 0:2.061-2.el7
perl-Net-Daemon.noarch 0:0.48-5.el7 perl-PlRPC.noarch 0:0.2020-14.el7
Complete!
##########################################################################################
我们通过配置文件可以看到默认安装的路径是 /var/lib/mysql
查看 /etc/my.cnf , 默认安装的,我什么也没有动
[root@fp-web-118 yum.repos.d]# cat /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
######################################################################
启动mysql如下
[root@fp-web-118 yum.repos.d]# /etc/init.d/mysqld start
Starting mysqld (via systemctl): [ OK ]
注: /etc/init.d/mysqld 实际也是shell文件,它和/usr/sbin/mysqld 是不同的,后者实际是二进制文件。
#######################################################################
查看进程
[root@fp-web-118 yum.repos.d]# ps -efww| grep mysql
root 77993 1 0 20:14 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysql
mysql 78198 77993 0 20:14 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock
/usr/sbin/mysqld是二进制文件,mysqld_safe实际是一个shell文件
所以有必要也要看看mysqld_safe和mysqld的区别。
########################################################################
登录mysql
[root@fp-web-118 yum.repos.d]# mysql -h localhost -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.51 MySQL Community Server (GPL)
Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
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> select version();
+-----------+
| version() |
+-----------+
| 5.6.51 |
+-----------+
1 row in set (0.00 sec)
安装的版本可以看到是5.6.51 ,当然想删除也很简单
首先查看一下系统内安装的mysql信息
[root@fp-web-118 yum.repos.d]# rpm -qa | grep mysql
mysql-community-common-5.6.51-2.el6.x86_64
mysql-community-client-5.6.51-2.el6.x86_64
mysql-community-libs-5.6.51-2.el6.x86_64
mysql-community-server-5.6.51-2.el6.x86_64
删除利用yum安装的mysql
yum -y remove mysql-community-common-5.6.51-2.el6.x86_64
这篇关于yum install mysql-community-server rpm方式安装mysql(社区版)的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-20部署MySQL集群入门:新手必读指南
- 2024-11-20部署MySQL集群教程:初学者指南
- 2024-11-20部署MySQL集群项目实战:新手教程
- 2024-11-20部署MySQL集群资料:新手入门教程
- 2024-11-20MySQL集群部署教程:入门级详解
- 2024-11-20MySQL集群教程:入门与实践指南
- 2024-11-20部署MySQL集群教程:新手入门指南
- 2024-11-20MySQL读写分离教程:轻松入门
- 2024-11-20部署MySQL集群入门:一步一步搭建你的数据库集群
- 2024-11-19部署MySQL集群学习:入门教程