Page 1 of 1

Domotica beginners problem

Posted: Mon Apr 11, 2016 4:35 pm
by p.bierhuizen
Everytime my Raspberry is started up, it comes with following errormessages in the logfile :

[MySQL] Database on host 'localhost'.
[Main] Couldn't open the database (called 'domotiga') Check './server-domotiga.conf' or create & load a database. Sleeping 2 seconds.
[Main] MySQL ERROR: Cannot open database: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
[Main] ERROR: Couldn't open the database (called 'domotiga') Check './server-domotiga.conf' or create & load a database. Sleeping 2 seconds.
[Main] MySQL ERROR: Cannot open database: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
[Main] ERROR: Couldn't open the database (called 'domotiga') Check './server-domotiga.conf' or create & load a database. Sleeping 2 seconds.
[Main] MySQL ERROR: Cannot open database: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
[Main] Connecting to database ...

Can someone here tell me what is happening and how I can avoid these error messages ?
Thanks in advance,
Paul Bierhuizen

Re: Domotica beginners problem

Posted: Tue Apr 12, 2016 9:16 am
by raymonvdm
Maybe Domotiga is starting before MySQL is running? Does the following command tells you that it is running?

Code: Select all

/etc/init.d/mysql status
Maybe you can add a sleep to the startup script or domotiga. Or the init file may need a sleept (/etc/init.d/domotiga?)

Re: Domotica beginners problem

Posted: Tue Apr 12, 2016 10:43 am
by p.bierhuizen
The mysql server is definitely running. I can access the db from another computer.
But adding a sleep in the startup script is a very good idea ! I am going to try that one.
Thanks for your help.

Re: Domotica beginners problem

Posted: Tue Apr 12, 2016 3:00 pm
by p.bierhuizen
Hello Raymon,
The mysql server is running. I can connect to it from another PC.
But the sleep was a very good idea. I have now added 'mysql' behind the Required-Start and Stop in domotigaserver3,
which will make sure that starting the domotigaserver will only take place after starting the mysql server.
I just tested it and it works fine now.
Thanks for your help,
Paul Bierhuizen