# MySql Server does not start



## Ishildur (Feb 14, 2009)

Hallo zusammen
Ich habe folgendes Problem:
Wenn ich das startup - script des mysql - servers aufrufe, bekomme ich keine Fehlermeldung und dennoch ist dieser schliesslich nicht gestartet. Ich bin ein absoluter FreeBSD Neuling und habe keine Ahnung, wie ich nun vorgehen kann oder muss. MÃ¶glicherweise kennt jemand dieses Problem und kÃ¶nnte mir aus der Patsche helfen? ;-)



> FreeBSD Server# ./mysql-server start
> Starting mysql.
> FreeBSD Server# ./mysql-server status
> mysql is not running.
> FreeBSD Server#


----------



## ale (Feb 14, 2009)

Please, read rule #1
http://forums.freebsd.org/faq.php?faq=vb_faq#faq_rules


----------



## Ishildur (Feb 14, 2009)

@ale
Oh, I'm really sorry for the inconvenience, off course I'll translate my post:

I've the following problem:
When I call the startup script of the mysql server, I don't get any error message but nevertheless it's finally not startet. I'm a completely Newbee of FreeBSD and therefore I've no idea what I may do in order to solve that problem. Maybe one of you guys know that problem and may help me out? ;-)

Thanks a lot


----------



## gilinko (Feb 14, 2009)

You need to add a variable to /etc/rc.conf to allow it to start. Add the following line:

mysql_enable="YES"

Allways check/read the rc script of installed software and it's defined there what is needed and what variables you can set, in this case /usr/local/etc/rc.d/mysql-server


----------



## ale (Feb 14, 2009)

Ishildur said:
			
		

> @ale
> Oh, I'm really sorry for the inconvenience, off course I'll translate my post:


No problem.


----------



## Ishildur (Feb 14, 2009)

@gilinko
First of all, thanks a lot for taking the time! ;-)
Well, the problem is, that I added this line to the /etc/rc.conf file. But the problem seems to be much worse:


This is a snapshot of the console after calling the start script.


> FreeBSD Server# ./mysql-server start
> Starting mysql.
> FreeBSD Server# ./mysql-server status
> mysql is not running.
> FreeBSD Server#



There is no entry in /var/db/mysql/<myhost>.err :-(


----------



## ale (Feb 14, 2009)

gilinko said:
			
		

> You need to add a variable to /etc/rc.conf to allow it to start. Add the following line:
> 
> mysql_enable="YES"


I think he had it, else there should be no output at all.
Am I correct?



			
				gilinko said:
			
		

> Allways check/read the rc script of installed software and it's defined there what is needed and what variables you can set, in this case /usr/local/etc/rc.d/mysql-server


The easiest way is to start the script with _rcvar_ as argument.


----------



## ale (Feb 14, 2009)

Can you try again after running `# mysql_install_db` ?


----------



## danger@ (Feb 14, 2009)

would be helpful to check /var/db/mysql/$hostname.err


----------



## ale (Feb 14, 2009)

danger@ said:
			
		

> would be helpful to check /var/db/mysql/$hostname.err



But he wrote


			
				Ishildur said:
			
		

> There is no entry in /var/db/mysql/<myhost>.err :-(


----------



## Ishildur (Feb 14, 2009)

Well I tried mysql_install_db but unfortunately it haven't changed anything. The curious thing is, that it once worked fine. But since yesterday, it's not starting anymore and there is no entry inside the corresponding log-file. Is there another logfile where I could catch a hint?


----------



## danger@ (Feb 14, 2009)

ah, I overlooked that one. Isildur, did you set a custom [font="Courier New"]mysql_dbdir[/font] in /etc/rc.conf?


----------



## Ishildur (Feb 14, 2009)

@danger@
No, I didn't... Please explain... ;-)


----------



## danger@ (Feb 14, 2009)

can you list contents of /var/db/mysql/?


----------



## Ishildur (Feb 14, 2009)

off course:



> FreeBSD Server# ls -l /var/db/mysql
> total 20542
> -rw-rw----  1 mysql  mysql      9264 Feb 14 16:12 FreeBSD Server.err
> -rw-rw----  1 mysql  mysql   5242880 Feb 14 16:12 ib_logfile0
> ...


----------



## danger@ (Feb 14, 2009)

well then you have to check the FreeBSD Server.err file.


----------



## Ishildur (Feb 14, 2009)

it's empty


----------



## Ishildur (Feb 14, 2009)

well, now I got something:



> 090214 16:46:14 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
> 090214 16:46:14  InnoDB: Started; log sequence number 0 46409
> 090214 16:46:14 [ERROR] Can't start server : Bind on unix socket: Address already in use
> 090214 16:46:14 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
> ...


----------



## Ishildur (Feb 14, 2009)

I've solved the problem. Don't ask me why, but for some reason the file /var/mysql.sock belonged to root instead of mysql. chown mysql /var/mysql.sock finally solved the problem.


----------



## Ishildur (Feb 14, 2009)

I've detected another problem which probably may have been the origin. Whenever I restart my server, the domain name doesn't exist anymore. Each time I have to set it by hostname <hostname>. Is there a way to automatize that procedure?


----------



## Ishildur (Feb 14, 2009)

Ok, I solved that problem too by adding the line hostname="<hostname>" into the file /etc/rc.conf

Thanks you a lot for your assistance guys, I really appreciate your help!


----------



## ale (Feb 14, 2009)

Do you have somthing like _hostname="<PUT_YOUR_FQDN_HERE>"_ in /etc/rc.conf?


----------



## Ishildur (Feb 14, 2009)

Yes, now I do ;-)


----------

