RSS

LuxCal Forum

The place for questions, suggestions and news about the LuxCal Event Calendar

User:   Password:   Remember Me?   
LuxCal Forum / General / Problems / Suddenly both calendars are showing "Could not connect to the MySQL server"
Posted:  16 Jul 2013 22:22
The calendars - I have 2 on this site one for services and another for events (http://www.middlemarchesbenefice.org/) have ceased to function and just show a line 'Could not connect to the MySQL server'.

Is there any trouble shooting that I can do to solve this please?  I'm assuming that it's a problem with my web host but I'm unsure as to how to or what to ask in the way of questions.  The calendars have been working flawlessly until a day or so ago.

Thanks

Ggraham
__________________
Graham
The Middle Marches Benefice
The villages of Bedstone & Bucknell
Posted:  16 Jul 2013 23:51   Last Edited By: Roel B.
Hi Graham,

The message is produced by the function dbConnect in the toolbox.php file. By the following two lines of code:

        $link = mysql_connect($dbHost,$dbUnam,$dbPwrd);
        if (!$link) { exit("Could not connect to the MySQL server"); }

This means that for one or another reason PHP cannot connect to the MySQL server any more using the following arguments:
- database server name (often 'localhost')
- db user name
- db password
The value of these arguments can be found in the file lcconfig.php in the calendar root folder.

So either your lcconfig.php file contents (the arguments mentioned above) has changed (which is unlikely, because you would know it) or your web host has changed something related to this MySQL server.

Can you still access the database(s) via the control panel of your web host?

Let me know if I can do more for you!
Roel
Posted:  17 Jul 2013 07:56
As always Roel you hit the nail squarely on the head.

Checking with my web host shows that both databases have gone missing from their system.  I'm hoping they can get them back but am not holding my breath.

Thanks for the heads up on the entries in the toolbox.php file - I shall ensure that if I have to set them up again that I use the same details.  It seems a long time ago that I set up my Luxcal calendars databases -  I must go back & read the installation instructions to ensure a smooth solution.

Best wishes

Graham
__________________
Graham
The Middle Marches Benefice
The villages of Bedstone & Bucknell
Posted:  17 Jul 2013 08:23
Just reading them again I realise I shall have to do another install - but I'll await the verdict from my web host first.
__________________
Graham
The Middle Marches Benefice
The villages of Bedstone & Bucknell
Posted:  17 Jul 2013 14:31
Well the web host found the databases & restored them but they failed me so I stated over again.

I am able to add categories, but once I try to add an event in either calendar, there are no dates/times displayed.  Have I missed a setting somewhere Roel please? 

If I use the + sign to add an event there is no monthly calendar displayed  but if I click on the back arrow for the Start then I get a monthly calendar - similarly if I do the same for the times I get the times grid - this is also the case for the End date and time.  If I enter a date then the Start date just shows 1 and then neither of the Start End back arrows work at all - in fact if I then try the back arrow by them the calendar comes up with undefined and NaN below it with the Mo Tu We Th etc and the today and clear buttons.
__________________
Graham
The Middle Marches Benefice
The villages of Bedstone & Bucknell
Posted:  17 Jul 2013 15:45
OK - sorted myself out - I hadn't entered the date format into the Administrations>Settings.
__________________
Graham
The Middle Marches Benefice
The villages of Bedstone & Bucknell
Posted:  17 Jul 2013 15:48   Last Edited By: Roel B.
Hello again Graham,
Good that the web host could restore the databases!
I had a look again at your web site and when starting the calendar it displays: Could not select the database
Not that this time it says "Could not select . . ." while previous time it could not connect.

The message is produced again by the function dbConnect in the toolbox.php file. By the following line of code:

        if (!mysql_select_db($dbName,$link)) { exit("Could not select the MySQL database"); }

This means it can now connect to the database server (hurray); but thereafter can't select the database with the name specified in the lcconfig.php file.

I guess when your web host restored the databases, they were not given the right names. The database should have the name specified by
$dbName="thenameofyourdatabase"; //database name
in the lcconfig.php file.

But apparently you were able to start the calendar, since you said that you were able to add categories. How can?
Or did you maybe re-install the calendar?
Roel
Posted:  01 Aug 2013 06:42
Thanks for your encouragement Roel.

Eventually I had to re-create the databases as the ones my host restored just wouldn't work.  But it all worked out fine and I improved my times to enter events :)
__________________
Graham
The Middle Marches Benefice
The villages of Bedstone & Bucknell
Posted:  01 Aug 2013 22:03
Hi Graham,
You could restore the weekly back up you made, I assume wink
Roel