Can't find my.cnf

Hi everybody today I'm facing a strange problem. Today iI wanted to change my MariaDB to slow query log, and when I try locate the my.cnf I just notice I haven't it on my server, I try use find / -name my.cnf and it don't find anything. Any suggestion or idea of what I could do about this?
 
What does ps -aux|grep mysql show you. It should show among other things, the location of my.cnf.

If you never did anything with it, it should be in /var/db/mysql/my.cnf
 
If you never did anything with it, it should be in /var/db/mysql/my.cnf
The file isn't installed by default. By default MySQL (and I presume MariaDB too) will take sane defaults without the need for a my.cnf.
 
You can find some examples in /usr/local/share/mysql. But IMHO they are not realistic for todays hardware. I keep mine in /usr/local/etc/my.cnf.
 
What does ps -aux|grep mysql show you. It should show among other things, the location of my.cnf.

If you never did anything with it, it should be in /var/db/mysql/my.cnf

This is my output when I did the ps -aux|grep mysql
And I never did anything with the my.cnf

The file isn't installed by default. By default MySQL (and I presume MariaDB too) will take sane defaults without the need for a my.cnf.

SirDice, do you recommend me to take this file from other server and put on mine?

You can find some examples in /usr/local/share/mysql. But IMHO they are not realistic for todays hardware. I keep mine in /usr/local/etc/my.cnf.

I didn't understand very well what you mean gkontos. And if it help in anyway my hardware is a Intel(R) Xeon(R) CPU E3-1245 V2 @ 3.40GHz with 32GB RAM.
 
I didn't understand very well what you mean gkontos. And if it help in anyway my hardware is a Intel(R) Xeon(R) CPU E3-1245 V2 @ 3.40GHz with 32GB RAM.

Well, my point is that usually those examples are way too old for modern hardware. So, if this is a dedicated database server you might want to change some values. I have used percona online tools in the past with good success. In any case, the location that you want to place my.cnf is /usr/local/etc/.
 
Well, my point is that usually those examples are way too old for modern hardware. So, if this is a dedicated database server you might want to change some values. I have used percona online tools in the past with good success. In any case, the location that you want to place my.cnf is /usr/local/etc/.

Okay, I'm going to take a look at this percona, I'm using tables in MyISAM, will it affect in anyway? And about the /usr/local/share/mysql I took the my-large.cnf and make this change what you think about?
Code:
query_cache_type = 1
query_cache_limit = 2M
query_cache_strip_comments = 1
query_cache_size = 16M
slow_query_log = ON
slow_query_log_file = "/var/log/slow_query.log"
 
From UPDATING:
20140521:
AFFECTS: users of databases/mariadb55*
AUTHOR: grembo@FreeBSD.org

The mariadb55-client and mariadb55-server port have been changed to respect hier(7) and behave like the mysql ports. Therefore mysql-server and mysql monitor will refuse to start if my.cnf exists in /etc or /etc/mysql.

In case you're affected, please move /etc/my.cnf to /usr/local/etc and/or /etc/mysql/my.cnf to /usr/local/etc/mysql.
 
Okay, I'm going to take a look at this percona, it work even with MyISAM? And about the /usr/local/share/mysql I took the my-large.cnf and make this change what you think about?

Percona is focused mainly on InnoDB. That does not mean that you can not still use their analyzing tools. I am sorry but for MyISAM I would only give poor advices. Maybe someone else could help better.
 
The file isn't installed by default. By default MySQL (and I presume MariaDB too) will take sane defaults without the need for a my.cnf.

By golly, you're right. To the OP, sorry for the misinformation, it's a my-default.cnf that's installed by default. Thanks.
 
Percona is focused mainly on InnoDB. That does not mean that you can not still use their analyzing tools. I am sorry but for MyISAM I would only give poor advices. Maybe someone else could help better.

Reading on Percona they said MyISAM is only recommended to experts then do you think a good idea I convert my tables to InnoDB? And about the Percona config they give me this one LINK. Should I change something? Or its already good.
 
MyISAM and InnoDB have different 'characteristics', each engine has it's own uses and you should use the one that fits your requirements the best. If you have lots of reads but hardly any writes MyISAM would be a little better. However, the drawback of MyISAM is that a write to a table will lock the entire table until the write is done. So if you have a lot of read and write access InnoDB would be better suited as it only locks tables partially (leaving the rest available) when writing.

There are some other considerations with InnoDB though, you really need to turn off the filesystem cache because InnoDB uses its own caching. You also need to account for any inconsistencies and cleanup. All InnoDB databases end up in one big file. It's therefor advisable to use File-per-table.

That said, you can easily convert a table from one engine to another. So start off with the default engine and see how things work out for you.
 
I spoke with a couple of people who is using the same system than me and they said they convert from MyISAM to InnoDB and is working well, then I'm going to do the same. At the moment thank you all who helped me.
 
Back
Top