Post new topic Reply to topic  [ 17 posts ] 
Author Message
 Post subject: No connection to database server without any changes of inst
PostPosted: 2014-05-26 12:15 
New user
New user

Joined: 2013-08-24 18:57
Posts: 12
Hi to everyone!

I`m using Win7, 64bit in German language on a home server and hmailserver in a relative new version (I can not read the version number actually because hmailserver doesn`t work correctly ...) with MySQL56. I made no changes this night ...

Until yesterday`s evening everything worked fine. Today`s morning I can`t connect via IMAP using Thunderbird 17.0.5. So I looked directly to hmailserver. Starting the hmailserver-administrator I get the message "Your database is not up to date and needs to be upgraded. Please run DBUpdater.exe to update the database. Current database version: 0 Required database version: 5320" Clicking on Connect to Host: localhost with Username: Administrator brings me back to the error message noticed before. So no connection to the database is possible.

ERROR_hmailserver_2014-05-26.log shows ""ERROR" 7376 "2014-05-26 11:47:26.541" "Severity: 2 (High), Code: HM5033, Source: DALRecordset::Open, Description: Can't connect to MySQL server on 'localhost' (10061)"" in the last line. And I can`t find any information in the file that helps me finding a solution.

hMailServer.INI shows this informations:
[Directories]
ProgramFolder=C:\Programme\Server\hMailServer
DatabaseFolder=
DataFolder=C:\Programme\Server\hMailServer\Data
LogFolder=C:\Programme\Server\hMailServer\Logs
TempFolder=C:\Programme\Server\hMailServer\Temp
EventFolder=C:\Programme\Server\hMailServer\Events
[GUILanguages]
ValidLanguages=english,german
[Database]
Type=MYSQL
Username=hmailserver
Password=...
PasswordEncryption=1
Port=3307
Server=localhost
Database=MySQL56
Internal=0
[Security]
AdministratorPassword=...

Services "hMailServer", "MySQL56" and "SQL-Server Browser" are running.

And I also tried to stop all services and re-run them in the order that hMailServer is starting at last. And I tried to change hMailServer.INI to Server=127.0.0.1 and to DatabaseFolder=C:\Programme\Server\hmailserver\Database. No change, it doesn`t work.

I hope someone can help me solve my trouble ... And if there are solutions in German language I would be very happy, because understanding this staff in English is very difficult for me ... But I try it, too!

Best regards,

Gerd


Top
 Profile  
 
 Post subject: Re: No connection to database server without any changes of
PostPosted: 2014-05-26 15:39 
Moderator
User avatar

Joined: 2007-06-14 05:12
Posts: 11889
Location: 'The Outback' Australia
Is your MySQL actually running?
Can you inspect tables with some sort of tool?

Also, I'd expect that
Database=MySQL56

should be

Database=hmailserver

I'd also bet that it's been a little while since a reboot of the machine occurred prior to this happening, and that someone had changed something in the hmailserver.ini without restarting hMailserver service

_________________
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
Documentation


Top
 Profile  
 
 Post subject: Re: No connection to database server without any changes of
PostPosted: 2014-05-26 18:12 
New user
New user

Joined: 2013-08-24 18:57
Posts: 12
Hi!

Yes, MySQL is running.

What do you mean by "Can you inspect tables with some sort of tool?"?

I tried to change to Database=MySQL56, but it doen`t work. And I have a copy of whole hmailserver directory of the last 7 days and everywhere the hMailServer.INI has the same content.

And the only one who changes anything on the server is me. But I changed nothing ...


Top
 Profile  
 
 Post subject: Re: No connection to database server without any changes of
PostPosted: 2014-05-26 19:13 
Senior user
Senior user
User avatar

Joined: 2009-10-20 16:33
Posts: 3141
Location: England
do you have MySQL Workbench installed ? You can check the schema name and port in there if you have it installed.

What is the schema name of your hmailserver database. It will have its own folder in mysql/data folder (usually)

database= should contain the schema name.

is mysql really using port 3307 and not 3306 which is the standard port?

is it really localhost and not 127.0.0.1 which is what I use.

can you see the mysql service running ?

And note that mysql service must be running before starting hmail service. The hmail service usually has a dependancy to ensure that mysql starts first but I think I noticed that sometimes it may not.

Windows updates can change things. Not specifically hmail things but priviledges and system accounts etc. Check all your service privledeges, i.e. MySQL and hMailserver.exe

and check windows event logs at startup and MySQL logs

_________________
An old dog learning new tricks...


Top
 Profile  
 
 Post subject: Re: No connection to database server without any changes of
PostPosted: 2014-05-26 19:45 
New user
New user

Joined: 2013-08-24 18:57
Posts: 12
Now I installed Workbench.

It seems that when I start the mysql service, it is only running a few seconds. Workbench shows Server Status=Stopped and I can start the service again. For a few seconds after starting the service I can see at Workbench taht it is running. But I can`t see any other information there. Everything is n/a, except "General log" and "Slow Query Log" are on.

I donb`t know why port is 3307, but it was like this the last 2 years since it runs on this machine.

And I already tried to replace localhost with 127.0.0.1 but there was no change in running. And as I see in the INI-files of the last 7 days, it was localhost every day.

And when I`m starting the services manually now for testing I mind that MySQL has to start first. The whole 2 years with this machines it worked automatically right. The machine is running the whole day and restarts automatically in the morning after saving everything on an other harddisk.

Do you think that there can be a corrupted MySQL? If I think to de-install MySQL and hmailserver and re-install it then, I don`t know which version of hmailserver I have do take, because I don`t know which version was running on the machine. Do you have an idea where I can find the version number now when hmailserver is not running correctly?


Top
 Profile  
 
 Post subject: Re: No connection to database server without any changes of
PostPosted: 2014-05-26 19:49 
New user
New user

Joined: 2013-08-24 18:57
Posts: 12
Now I have the reason for using port 3307. There is another MySQL database in another file directory which is used by a program for a webshop. And this database uses port 3306.


Top
 Profile  
 
 Post subject: Re: No connection to database server without any changes of
PostPosted: 2014-05-26 20:07 
Senior user
Senior user
User avatar

Joined: 2009-10-20 16:33
Posts: 3141
Location: England
But MySQL only uses one port as far as I know. So which port is it configured to use.

You can have as many databases (shemas) in MySQL as you like and all aplications use the same port to get to MySQL.

So does your other application work currently on port 3306? Did you instal MySQL 5.6 recently? How recently?

Do you have more than one MySQL service running ? If so I presume they are using different ports and which one is hmail trying to use.

_________________
An old dog learning new tricks...


Top
 Profile  
 
 Post subject: Re: No connection to database server without any changes of
PostPosted: 2014-05-26 20:17 
Senior user
Senior user
User avatar

Joined: 2009-10-20 16:33
Posts: 3141
Location: England
I think you must be using the hmail provided MySQL which was auto configured to use port 3307.

Now you have installed version 5.6 of MySQL it has probably overwritten your hmail version of MySQL service. Not too sure about that.

Somewhere you will have a folder with your hmail databse in it. Its probably called hmailserver.

When you installed mysql 5.6 it will have created a folder somewhere called mysql/data I think.

Try this: copy your hmail database folder into that the mysql/data folder. Change your hmailserver.ini to 3306. Change database= to be whatever the hmail database folder name is, probably hmailserver so you have database=hmailserver.
then restart MySQL and hmailserver.

Note: your hmailserver folder may alreay be in the correct place so you have hmailserver and your other schema folder in mysql/data. In workbench the server status tells you which port MySQL is using. Both applications should be using that.

So, in short it may be as simple as changing port in hmailserver.ini to 3306 now that you have installed MySQL 5.6.

What happens?

_________________
An old dog learning new tricks...


Top
 Profile  
 
 Post subject: Re: No connection to database server without any changes of
PostPosted: 2014-05-26 20:31 
Senior user
Senior user
User avatar

Joined: 2009-10-20 16:33
Posts: 3141
Location: England
You can change service dependancies with the windows command prompt sc.

When MySQL 5.6 was installed it may have affected dependancies.

_________________
An old dog learning new tricks...


Top
 Profile  
 
 Post subject: Re: No connection to database server without any changes of
PostPosted: 2014-05-26 20:41 
New user
New user

Joined: 2013-08-24 18:57
Posts: 12
I just tried to change the port in hMailServer.INI to 3306. Then I stopped the service "MySQL56" and "hmailserver". Then I started first "MySQL" and second "hMailServer". Then I started hMailServer-adminstrator. This is the following error: "The connection to the database is not available. Acces denied for user 'hmailserver'@'localhost' (using password:YES)". I started Workbench and it says that Server Status is stopped.


Top
 Profile  
 
 Post subject: Re: No connection to database server without any changes of
PostPosted: 2014-05-26 20:52 
New user
New user

Joined: 2013-08-24 18:57
Posts: 12
Now I tried the command prompt sc (which I didn`t know until now! Thanks!):

I will add a picture of the shown infomations.


Attachments:
File comment: command prompt sc
hc_014.png
hc_014.png [ 8.73 KiB | Viewed 228 times ]
Top
 Profile  
 
 Post subject: Re: No connection to database server without any changes of
PostPosted: 2014-05-26 21:21 
Senior user
Senior user
User avatar

Joined: 2009-10-20 16:33
Posts: 3141
Location: England
so you have two MySQL services.

mysql56 and mysql

I would suggest that there may be some contention between the two of them. You should only need one.

try what I suggested. Locate the folder of your hmail db and copy that whole folder to the new mysql5.6/data folder if its not already there.

Stop the mysql service and disable it. Then try starting the MySQL56 service and see what happens. Everything should be set to use port 3306. And hmailserver.ini database=hmailserver (most likely)

_________________
An old dog learning new tricks...


Top
 Profile  
 
 Post subject: Re: No connection to database server without any changes of
PostPosted: 2014-05-27 00:18 
Moderator
User avatar

Joined: 2007-06-14 05:12
Posts: 11889
Location: 'The Outback' Australia
3307 is very likely builtin MySQL in ver 4 of hMailsevrer

You can have both that the full MySQL running at same time

Issue here is that the hmailserver.ini is not really talking to either, just a weird combination of both


Change the hmailserver.ini to be like this
(again a change in hmailserver.ini won't have effect until the service is restarted - I suspect that the .ini changed a while back but the service wasn't restarted).

[Directories]
ProgramFolder=C:\Programme\Server\hMailServer
DatabaseFolder=
DataFolder=C:\Programme\Server\hMailServer\Data
LogFolder=C:\Programme\Server\hMailServer\Logs
TempFolder=C:\Programme\Server\hMailServer\Temp
EventFolder=C:\Programme\Server\hMailServer\Events
[GUILanguages]
ValidLanguages=english,german
[Database]
Type=MYSQL
Username=hmailserver
Password=...
PasswordEncryption=1
Port=3307
Server=localhost
Database=hmailserver
Internal=0
[Security]
AdministratorPassword=...

_________________
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
Documentation


Top
 Profile  
 
 Post subject: Re: No connection to database server without any changes of
PostPosted: 2014-05-27 03:11 
Senior user
Senior user
User avatar

Joined: 2009-10-20 16:33
Posts: 3141
Location: England
can't figure out how his website is working if its using mysql56 service and it won't start. Nothing to do with hmail but I figured he's got to get both of them working.

_________________
An old dog learning new tricks...


Top
 Profile  
 
 Post subject: Re: No connection to database server without any changes of
PostPosted: 2014-05-27 03:23 
Moderator
User avatar

Joined: 2007-06-14 05:12
Posts: 11889
Location: 'The Outback' Australia
Poskowski wrote:
Now I installed Workbench.

It seems that when I start the mysql service, it is only running a few seconds.

percepts wrote:
can't figure out how his website is working if its using mysql56 service and it won't start.


I suspect that the MySQL56 starts just fine, and that is used for the website

I suspect that the MySQL service doesn't start (or starts and then stops because it is not being used) and that this is the one used by hMailsevrer.

I think that MySQL logs will help here. I still believe that the database name NEEDS to be hmailserver in the .ini and that this is NOT configurable (hMailserver creates it's own database on the SQL server - always has). Perhaps the user that the MySQL service runs under has been changed, perhaps there is some other issue with the old built-in MySQL. Logs will help.

_________________
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
Documentation


Top
 Profile  
 
 Post subject: Re: No connection to database server without any changes of
PostPosted: 2014-05-27 03:38 
Senior user
Senior user
User avatar

Joined: 2009-10-20 16:33
Posts: 3141
Location: England
My suspicion is that he's just installed MySQL56 and has screwed up somewhere during that process which he thought wouldn't affect hmail. But don't really know what he's done as he didn't answer the question about when he installed it.

And version 5.6 would have been the hmail provided version as its quite recent so I don't know how come he's got it in his hmaiserver.ini as the database. He must have been fiddling with it since installing 5.6.

_________________
An old dog learning new tricks...


Top
 Profile  
 
 Post subject: Re: No connection to database server without any changes of
PostPosted: 2014-05-27 04:20 
Senior user
Senior user
User avatar

Joined: 2009-10-20 16:33
Posts: 3141
Location: England
percepts wrote:
My suspicion is that he's just installed MySQL56 and has screwed up somewhere during that process which he thought wouldn't affect hmail. But don't really know what he's done as he didn't answer the question about when he installed it.

And version 5.6 would NOT have been the hmail provided version as its quite recent so I don't know how come he's got it in his hmaiserver.ini as the database. He must have been fiddling with it since installing 5.6.


oops, I meant NOT

_________________
An old dog learning new tricks...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ] 


Who is online

Users browsing this forum: No registered users and 9 guests



Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group