根据 MySQL 文档,2.10.1 Initializing the Data Directory :
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 thebin
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/