# Mysql Not Starting



## ssarkarnetip (Aug 26, 2010)

I am having issues getting mysql starting on FreeBSD 8.0.  I am using the ports directory to install mysql. Mysql seems to not understand my my.cnf.  I am using the newest stable version of mysql.

I am getting the following error.


```
Starting mysqld daemon with databases from /var/db/mysql/mysql
STOPPING server from pid file /var/run/mysqld/mysql.pid
100826 12:51:14  mysqld ended
```

A copy of my.cnf is also in this attachment.


----------



## da1 (Aug 26, 2010)

change the owner of the "mysql" folder to mysql:mysql and try again


----------



## wblock@ (Aug 26, 2010)

ssarkarnetip said:
			
		

> Mysql seems to not understand my my.cnf.  I am using the newest stable version of mysql.



Did you put my.cnf in the right place for FreeBSD?  Config files are usually in a subdir of /usr/local/etc.


----------



## User23 (Aug 29, 2010)

da1 answer should fix your problem.

---
@wblock

The start script runs the mysqld with 
	
	



```
--defaults-extra-file=${mysql_dbdir}/my.cnf
```
, so the my.cnf should be in your mysql_dbdir which is /var/db/mysql as default. 

Example files for the my.cnf can be found in /usr/local/share/mysql.


```
ls /usr/local/share/mysql | grep my-
my-huge.cnf
my-innodb-heavy-4G.cnf
my-large.cnf
my-medium.cnf
my-small.cnf
```


----------



## ssarkarnetip (Sep 2, 2010)

I tried these.  Everything is in the right area.  Can you check my.cnf?  I put that file there.  Should I try a new my.cnf file?


----------



## ssarkarnetip (Sep 2, 2010)

I get this error.  I saw a solution in another post but I do not understand it.


```
/usr/local/libexec/mysqld: Too many arguments (first extra is '.pid'
```

http://forums.freebsd.org/showthread.php?t=16650&page=2


----------



## ssarkarnetip (Sep 2, 2010)

I got it working.  I did change the mysql folder to the create permissions. I also had to change the following as well.
/usr/local/libexec/mysqld

  I had to rerun mysql_install_db as well.  I change the permission on that file to mysql as well.
I also changed the ownership of /tmp to mysql.  I was wondering if this would be a permissions problem to keep /tmp owned by mysql.


----------



## DutchDaemon (Sep 2, 2010)

Don't do that. The typical permissions for /tmp are achieved by `chmod 1777 /tmp`.


----------

