Linux 查看数据库MySQL安装文件和安装目录的命令
文章目錄
- 數(shù)據(jù)庫 MySQL 相關(guān)目錄說明
- /var/lib/mysql
- /usr/bin
- /usr/share/mysql
- /usr/lib/mysql
- /etc/my.cnf
 
- 查看 MySQL 相關(guān)文件/目錄的命令
- 查看已安裝的 MySQL 相關(guān)軟件包名稱
- 查看某個軟件包的所有安裝文件
- 查看 MySQL 相關(guān)的所有文件
- 使用命令 find 查找含有 mysql 關(guān)鍵字的文件路徑
- 使用命令 which
- 使用命令 whereis
 
- 查看數(shù)據(jù)庫的安裝目錄
數(shù)據(jù)庫 MySQL 相關(guān)目錄說明
不同版本的數(shù)據(jù)庫和不同的操作系統(tǒng)下,MySQL 的相關(guān)目錄應(yīng)該會不同。
測試系統(tǒng)的版本信息:
 CentOS Linux release 8.2.2004 (Core)
測試數(shù)據(jù)庫的版本信息:
 5.7.31 MySQL Community Server (GPL)
 mysql Ver 14.14 Distrib 5.7.31, for Linux (x86_64) using EditLine wrapper
/var/lib/mysql
該目錄存放數(shù)據(jù)庫運行時要改變的數(shù)據(jù),例如:數(shù)據(jù)庫文件、日志文件、緩存文件等。
/usr/bin
數(shù)據(jù)庫的有關(guān)命令會存放在這個目錄下,如下:
mysql mysqladmin mysqlbinlog mysqlcheck mysql_config_editor mysqld_pre_systemd mysqldump mysqldumpslow mysqlimport mysql_install_db mysql_plugin mysqlpump mysql_secure_installation mysqlshow mysqlslap mysql_ssl_rsa_setup mysql_tzinfo_to_sql mysql_upgrade/usr/share/mysql
數(shù)據(jù)庫配置文件目錄
/usr/lib/mysql
數(shù)據(jù)庫的安裝路徑
/etc/my.cnf
數(shù)據(jù)庫的配置文件
查看 MySQL 相關(guān)文件/目錄的命令
查看已安裝的 MySQL 相關(guān)軟件包名稱
[root@htlwk0001host bin]# rpm -qa|grep mysql mysql-community-server-5.7.31-1.el7.x86_64 mysql-community-common-5.7.31-1.el7.x86_64 mysql57-community-release-el7-10.noarch mysql-community-client-5.7.31-1.el7.x86_64 php-mysqlnd-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64 mysql-community-libs-5.7.31-1.el7.x86_64查看某個軟件包的所有安裝文件
[root@htlwk0001host bin]# rpm -ql mysql-community-server-5.7.31-1.el7.x86_64 /etc/logrotate.d/mysql /etc/my.cnf /etc/my.cnf.d /usr/bin/innochecksum /usr/bin/lz4_decompress /usr/bin/my_print_defaults查看 MySQL 相關(guān)的所有文件
[root@htlwk0001host bin]# rpm -qal|grep mysql /etc/logrotate.d/mysql /usr/bin/mysql_install_db /usr/bin/mysql_plugin /usr/bin/mysql_secure_installation /usr/bin/mysql_ssl_rsa_setup /usr/bin/mysql_tzinfo_to_sql /usr/bin/mysql_upgrade /usr/bin/mysqld_pre_systemd /usr/bin/mysqldumpslow /usr/lib/systemd/system/mysqld.service /usr/lib/systemd/system/mysqld@.service /usr/lib/tmpfiles.d/mysql.conf使用命令 find 查找含有 mysql 關(guān)鍵字的文件路徑
使用命令 which
使用命令 which 查找命令 mysql 的絕對路徑,如下結(jié)果所示,可執(zhí)行文件 mysql 在目錄 /usr/bin/ 下面:
[root@htlwk0001host mysql]# which mysql /usr/bin/mysql使用命令 whereis
使用命令 whereis 查找和顯示命令 mysql 的二進制程序、源代碼文件和man手冊頁等相關(guān)文件的路徑:
[root@htlwk0001host mysql]# whereis mysql mysql: /usr/bin/mysql /usr/lib64/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz說明:
 whereis 命令和 find 類似,不同的是 whereis 是通過本地架構(gòu)好的數(shù)據(jù)庫索引查找會比較快。沒有更新到數(shù)據(jù)庫里面的文件或命令則無法查找。
查看數(shù)據(jù)庫的安裝目錄
mysql> show variables like '%char%'; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8mb4 | | character_set_connection | utf8mb4 | | character_set_database | utf8mb4 | | character_set_filesystem | binary | | character_set_results | utf8mb4 | | character_set_server | utf8mb4 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+ 8 rows in set (0.00 sec)看上面的 character_sets_dir= /usr/share/mysql/charsets/,據(jù)此得知 MySQL 的安裝目錄是: /usr/share/mysql
總結(jié)
以上是生活随笔為你收集整理的Linux 查看数据库MySQL安装文件和安装目录的命令的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: ac管理器设置(ac管理系统)
- 下一篇: Mac OS 在远程主机(Linux 系
