15

I did updatedb. I did locate my.cnf

But I cannot find it? Nothing.

(I installed MYSQL using aptitude install mysql-server, and mysql does work right now.)

TIMEX
  • 259,804
  • 351
  • 777
  • 1,080

4 Answers4

25

What is your operating system ? On Debian Linux, it is located on /etc/mysql/my.cnf. If your cannot find it, you can create one from scratch using this documentation.

Sam Alba
  • 861
  • 1
  • 9
  • 10
  • Do I just make the file and put it inside /etc/mysql/my.cnf? MYSQL will automatically use that? – TIMEX Dec 09 '09 at 19:00
  • 1
    If you use Debian Linux or something similar, check the right location in the file /etc/init.d/mysql. In my case I can see CONF=/etc/mysql/my.cnf on the line 25. – Sam Alba Dec 10 '09 at 13:35
8

You can try following command:

find /etc -name *.cnf

it will show you all locations of *.cnf files

psihodelia
  • 29,566
  • 35
  • 108
  • 157
  • Yes. That should find it. He may have to do a "sudo find /etc -name *.cnf" though. – Sigersted Dec 09 '09 at 22:17
  • you are a hero. your answer proved to be a great start for me to solve an issue i have been stuck for ages. :) – Ali Jan 19 '17 at 08:12
0

locate will only print files in directories that you can read.

Also, when you say you did updatedb, did you run

sudo /etc/cron.daily/slocate

If not, then probably what you did run wasn't equivalent. (The default locate program on Debian/Ubuntu these days is mlocate).

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
0

create a configuration file MySQL provides several configuration methods but, in general, it is easiest to to create a my.ini file in the mysql folder. There are hundreds of options to tweak MySQL to your exact requirements, but the simplest my.ini file is:

[mysqld]
# installation directory
basedir="C:/mysql/"

# data directory
datadir="D:/MySQLdata/"
Lijo
  • 6,498
  • 5
  • 49
  • 60