# [RESOLVED] MySQL basic question



## fred974 (Feb 24, 2014)

Hello all,

I have installed MySQL 5.6 in my FreeBSD jail.
Now, when I looked at some articles online to secure MySQL, It came to my attention that by default, the my.cnf file seem to be located at /usr/local/etc/my.cnf. On my system, the file is located at /usr/local/my.cnf. I also seen some tutorial doing `cp /usr/local/share/mysql/my-medium.cnf /var/db/mysql/my.cnf`

Have I done something wrong and should I move the file to  /usr/local/etc/my.cnf

Thank you
Fred


----------



## SirDice (Feb 24, 2014)

*Re: MySQL basic question*

By default the MySQL rc(8) script will look for my.cnf in /var/db/mysql/ unless you set mysql_optfile to another location. See the /usr/local/etc/rc.d/mysql-server script.


----------



## fred974 (Feb 24, 2014)

*Re: MySQL basic question*



			
				SirDice said:
			
		

> By default the MySQL rc(8) script will look for my.cnf in /var/db/mysql/ unless you set mysql_optfile to another location. See the /usr/local/etc/rc.d/mysql-server script.


Thank you 
My  /usr/local/etc/rc.d/mysql-server file has got 

```
: ${mysql_optfile="${mysql_dbdir}/my.cnf"}
```
How do I know what is the path that 
	
	



```
{mysql_dbdir}
```
 refers to?
ie: var/db/mysql/ or whatever


----------



## chatwizrd (Feb 24, 2014)

*Re: MySQL basic question*

I just put mine in /etc/my.cnf and it had no problem finding it.


----------

