mysql - 在 Ubuntu 上使用 APT 安装的 MySQL 的 BASEDIR 在哪里?

标签 mysql linux bash ubuntu apt

根据 MySQL 文档,2.10.1 Initializing the Data Directory :

  1. Change location into the top-level directory of your MySQL installation, represented here by BASEDIR:

    shell> cd BASEDIR

    BASEDIR is likely to be something like /usr/local/mysql or /usr/local. The following steps assume that you have changed location to this directory.

    You will find several files and subdirectories in the BASEDIR directory. The most important for installation purposes is the bin subdirectory, which contains the server as well as client and utility programs.

我检查过/usr/local/mysql 和/usr/local,但它们都不包含任何与MySQL 相关的内容。 which mysql 返回 /usr/bin/mysql,但我不认为 /usr/bin 会是 MySQL 的基本目录。

文档说我需要在 BASEDIR 下创建一个名为 mysql-files 的目录,所以我想知道在哪里可以找到它。

最佳答案

基本目录是一个系统变量,所以如果你想知道它是什么,你应该可以简单地询问运行中的服务器:

mysql> SELECT @@BASEDIR;

https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_basedir

关于mysql - 在 Ubuntu 上使用 APT 安装的 MySQL 的 BASEDIR 在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44867039/

相关文章:

bash - shell cut命令删除字符

Php-Django Chimera : is it possible?

java - 如何从一个类调用另一个类的方法?

linux - struts2 项目未在 tomcat7 中正确部署

javascript - Google Chrome - 如何打开默认缩放级别?

python - 如何在 bash 脚本中导入 python 文件? (在我的 bash 脚本中使用 python 值)

Mysql自动递增10乘10

mysql - 如何对 MySQL 查询的输出进行分组,我想按 ID 求和EquipCost 输出。即我希望 accountCost 由他们的帐户求和

bash - 将我的bash的输出重定向到日志文件

bash - bash heredoc 可以将其结果直接放入变量中吗?