mysql默认安装位置及各目录作用

On Windows, the default installation directory is C:\mysql, which has the following subdirectories:

Directory

Contents of Directory

bin

Client programs and the mysqld server

data

Log files, databases

Docs

Documentation

examples

Example programs and scripts

include

Include (header) files

lib

Libraries

scripts

Utility scripts

share

Error message files


Installations created from Linux RPM distributions result in files under the following system directories:

Directory

Contents of Directory

/usr/bin

Client programs and scripts

/usr/sbin

The mysqld server

/var/lib/mysql

Log files, databases

/usr/share/doc/packages

Documentation

include/usr/include/mysql

Include (header) files

lib/usr/lib/mysql

Libraries

/usr/share/mysql

Error message and character set files

sql-bench/usr/share/sql-bench

Benchmarks


On Unix, a tar file binary distribution is installed by unpacking it at the installation location you choose (typically/usr/local/mysql) and creates the following directories in that location:

Directory

Contents of Directory

bin

Client programs and the mysqld server

data

Log files, databases

docs

Documentation, ChangeLog

include

Include (header) files

lib

Libraries

scripts

mysql_install_db

share/mysql

Error message files

sql-bench

Benchmarks


A source distribution is installed after you configure and compile it. By default, the installation step installs files under/usr/local, in the following subdirectories:

Directory

Contents of Directory

bin

Client programs and scripts

include/mysql

Include (header) files

info

Documentation in Info format

lib/mysql

Libraries

libexec

The mysqld server

share/mysql

Error message files

sql-bench

Benchmarks and crash-me test

var

Databases and log files


http://blog.chinaunix.net/uid-7692530-id-2567575.html

### 各操作系统下 MySQL 默认安装路径 #### Linux 系统 在Linux系统中,MySQL默认安装路径通常如下: - **二进制文件**:`/usr/bin/mysql*` 或 `/usr/sbin/mysqld` - **配置文件**:`/etc/my.cnf` 或者 `/etc/mysql/my.cnf` - **数据目录**:`/var/lib/mysql` 这些路径可能会因不同的发行版而有所差异。对于某些特定版本或通过包管理器安装的情况下,路径可能有所不同。 ```bash # 查找mysqld进程所在的位置 which mysqld ``` 为了确认具体的安装路径,可以通过命令行工具来查询[^1]。 #### Windows 系统 针对Windows平台上的MySQL默认安装位置一般位于: - **程序文件夹**:`C:\Program Files\MySQL\MySQL Server X.X\` (其中X.X代表版本号) - **数据存储目录**:`C:\Program Files\MySQL\MySQL Server X.X\data\[database_name]\` 需要注意的是,在指定“Data Path”的时候不需要额外添加"data"子文件夹名称,因为安装过程中会自动创建该文件夹[^3][^5]。 如果用户选择了自定义安装,则实际路径取决于当时的选择;另外,也可以通过查看环境变量或者注册表项获取确切的信息。 #### macOS 系统 对于macOS而言,Homebrew是最常用的软件包管理系统之一,它用来简化开源项目的编译过程并提供便捷的更新机制。当使用Homebrew安装MySQL时,默认情况下会被放置于以下位置: - **主应用程序目录**:`/usr/local/mysql` - **配置文件**:`/usr/local/etc/my.cnf` - **数据文件夹**:`/usr/local/var/mysql` 当然,这同样适用于其他方式如DMG镜像直接下载安装的方式,不过具体路径还是依据官方文档为准。 验证MySQL服务状态的方法是在终端输入相应指令检查其是否正常工作以及监听端口情况[^2]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值