0

I'm trying to find file my.cnf per this SO post. With one of the answers there I typed mysqladmin --help after ssh ing into my remote server.

Part of the output:

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 

So from my root, I typed ls -la to see all files:

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

There's no etc folder to look for my.cnf. Where would this file be?

suish
  • 3,253
  • 1
  • 15
  • 34
Doug Fir
  • 19,971
  • 47
  • 169
  • 299

3 Answers3

0

I think your current folder is wrong, using command pwd to know where you are. From your root, try cd to those folders, then use ls -la:

cd /etc
ls -la

cd /etc/mysql
ls -la

cd /usr/etc
ls -la
le hien
  • 131
  • 2
  • 15
0
/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

You can edit the files and change directories to the directories.

cd /etc
vi /etc/my.cnf

The location of your specific config is dependent on how you installed mysql. If you used apt-get I believe its located in /etc/mysql/my.cnf. Therefor to edit the file you could run:

vi /etc/mysql/my.cnf

typically ~/.my.cnf is used for User-specific options. Please see https://dev.mysql.com/doc/refman/8.0/en/option-files.html

Jason Heithoff
  • 508
  • 3
  • 10
0

Found the answer over here. I am in the root directory not / (confusing).

cd /

Then I could see directory.

Doug Fir
  • 19,971
  • 47
  • 169
  • 299