我正在尝试查找每个SO帖子的文件my.cnf。有了其中一个答案,我在ssh进入我的远程服务器后输入了mysqladmin --help。
输出的一部分:
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf 因此,在我的根目录中,我输入了ls -la来查看所有文件:
drwxr-xr-x 4 ubuntu ubuntu 4096 Jul 18 02:03 .
drwxr-xr-x 3 root root 4096 Jul 17 14:06 ..
-rw-r--r-- 1 ubuntu ubuntu 220 Apr 9 2014 .bash_logout
-rw-r--r-- 1 ubuntu ubuntu 3637 Apr 9 2014 .bashrc
drwx------ 2 ubuntu ubuntu 4096 Jul 17 14:09 .cache
-rw-rw-r-- 1 ubuntu ubuntu 0 Jul 17 14:09 .cloud-locale-test.skip
-rw------- 1 ubuntu ubuntu 1004 Jul 18 02:03 .mysql_history
-rw-r--r-- 1 ubuntu ubuntu 675 Apr 9 2014 .profile
drwx------ 2 ubuntu ubuntu 4096 Jul 17 14:06 .ssh没有用于查找my.cnf的etc文件夹。这个文件会在哪里?
发布于 2018-07-18 10:46:16
我认为您当前的文件夹是错误的,使用pwd命令来了解您所在的位置。在根目录中,尝试cd进入这些文件夹,然后使用ls -la:
cd /etc
ls -la
cd /etc/mysql
ls -la
cd /usr/etc
ls -la发布于 2018-07-18 10:54:05
/etc <-- is a directory
/etc/my.cnf <-- is a file
/etc/mysql <-- directory
/etc/mysql/my.cnf <-- file
/usr <-- directory
/usr/mysql <-- directory
/usr/mysql/my.cnf <-- file
~/ <-- ~ special notation to indicate home directory of the current logged in user
~/.my.cnf <-- user specific config for MySQL您可以编辑这些文件,并将目录更改为这些目录。
cd /etc
vi /etc/my.cnf特定配置的位置取决于您安装mysql的方式。如果你使用apt-get,我相信它位于/etc/mysql/my.cnf。因此,要编辑您可以运行的文件:
vi /etc/mysql/my.cnf通常,~/.my.cnf用于特定于用户的选项。请参阅https://dev.mysql.com/doc/refman/8.0/en/option-files.html
发布于 2018-07-18 23:00:09
https://stackoverflow.com/questions/51392775
复制相似问题