Link to home
Start Free TrialLog in
Avatar of Peter Chan
Peter ChanFlag for Hong Kong

asked on

Issue with Mysql

Hi,
I've selected details like
User generated image
but I encounter issue below. Why?
User generated image
Avatar of lenamtl
lenamtl
Flag of Canada image

Hi,
If you copy it manually mysql client in hMailserver bin directory is it working?
One, you are pointing to a public ip, this might be being blocked by firewall.
182.1...
Avatar of Peter Chan

ASKER

Arnold,
How to ensure it is going through firewall?
you could try telnet <ipadress>:3306
If it is blocked it depends upon the settings of the firewall rules on the hosting system.
I would not expose MySQL or any database to external.

If you have ssh connection to that remote server, use ithe ssh connection with a tunnel,

local tunnel port 1234 to 127.0.0.1:3306

Once the ssh connection is established, use the client to connect to localhost:1234 which will go through the ssh tunnel to the MySQL server on the remote server.
Sorry to that I get
User generated image
Arnold,
Can I have more details regarding the tunnel?
my error replace the : with a space
telnet <ipaddress> <port>
Tunnel, is using ssh not telnet.
If you use putty, look at ssh, tunnel section.
Avatar of skullnobrains
skullnobrains

you need to grab the mysql dll and copy it into the directory.

the mysql client library used to be gpl-licenced which prevented to embed it into non-gpl projects. hmail is apparently still using the older client and they are not allowed to bundle the mysql dll. this made little difference at first because neither sun or monty would be dumb enough to sue anyone over this. but mysql now belongs to oracle...

newer clients are using different licences such as apache, creative commons, bsd, or even no licence at all

#gpl_is_evil

you probably also should run the mysql server and hmail in the same location. other than obvious security possible issues, separate locations will make it slower than remotely connecting to the other location over imap.
Where to get Mysql dll file of this?
i'd recommend you download the mysql client
it is likely to work out of the box if you install in the default location

if not, you'll need to copy the dll to hmail's dir or tell it where to find the dll

https://dev.mysql.com/downloads/installer/
or
https://downloads.mariadb.com/Connectors/c/connector-c-3.1.4/

beware to pick the correct 32/64 bytes version

note : this is a google monkety question. i'm normally not helping with those unless you demontrate you at least somehow tried.
Sorry, where is the download of Mysql client?
Any help?
You need to be clearer. The MySQL client is part of the MySQL server package, in bin MySQL.exe you can see there whether the .dll you are missing is there and copy it.
I provided you links that should contain the required dll. What else do you need ?
Hi,
Have you copy manually the mysql client in hMailserver bin directory?

Like I suggest
https://www.experts-exchange.com/questions/29159434/Issue-with-Mysql.html?anchorAnswerId=42950074#a42950074

The error is self explanatory....
I copied file like

C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.dll

but it is having issue:

Starting task...
Please wait while updating database settings...
Error:
The MySQL client (libmysql.dll, 32 bit) could not be loaded.
hMailServer needs this file to be able to connect to MySQL.
The MySQL client needs to be manually copied to the hMailServer Bin directory. The file is not included in the hMailServer installation.
Path: C:\Program Files (x86)\hMailServer\Bin\libmysql.dll

Open in new window

is this due to 32-bit problem?
Yes, look in c:\program files (x86) for libmysql.dll

https://www.hmailserver.com/forum/viewtopic.php?t=27557

Look for older versions that have 32 bit options/installer
Do you have the .dll in place in this specific directory
C:\Program Files (x86)\hMailServer\Bin\libmysql.dll
Arnold,
I don't see the other 32-bit file.

Lenamtl,
Yes, I put file libmysql.dll into

C:\Program Files (x86)\hMailServer\Bin\
And libmysql.dll is the 32 bit one ?

You may want to read this https://www.hmailserver.com/forum/viewtopic.php?t=26759
Sorry to that, I do not see "workbench .." folder within

C:\Program Files (x86)\MySQL

Does it mean we should set up 32-bit Mysql client on the machine?
Yes, hmailserver is seemingly a 32bit application, it can not use 64bit dll.

You gave to download an older version of MySQL that came with 32.
https://dev.mysql.com/downloads/mysql/5.6.html
Thanks.
How to resolve error below?
User generated image
Use 127.0..1 for the mySQL server

Use workbench's mysql administration tool  connecting to localhost and add the LAN ip to allowed host for the hmailserver ur of allow the hmailserver' mysqli login user access from any host (%)
Sorry, how about this?
User generated image
You have to use MySQL native passwords since hmailserver depends on an older MySQL version.
The MySQL.dll relied upon, lacks the sha2 functionality.

Another option to look at is
https://www.hmailserver.com/documentation/latest/?page=details_cache
Can we change file MySQL.dll?
no. and there is no reason to do so if arnold is right which seems likely. try that first.
Does it mean I should try with older version of Mysql instead?
Hi,

I don't know if this setup is for test or production, but if this is not production,
I would recommend to start over and use more recent MySQL and if possible more recent computer so you will use 64 bit.
If you are in production mode try to see if this is possible to update without too much work.
The issue is: the asker is deploying hmailserver with a MySQL backend
Hmailserver is a 32 bit application has not been updated since 2017.
The user has the newest MySQL version installed, but the connector (MySQL.dll) that works with the application (32 bit) is from an older, 5.6 version ....

This is the issue, the MySQL login have to use native versus sha2.
I've altered the user account to reset mysql_native_password but I still get this

User generated image
ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Here is what I've got
User generated imageUser generated image
do not use the "mysql" database. this is an internal database that is not expected to be used in projects. pick a different name such as "hmail"

this should allow the rest of your setup to work.

--

in production, you had better use a different user. not root.

you need to grant the adequate privileges.
- connect to the server as root. either from the command line or whatever admin tool you like.
- grant SELECT INSERT UPDATE DELETE privileges on the hmail database to the hmail user from the adaquate host
- change your hmail settings to use the "hmail" user
Skull, pointed to the last issue, the question for database is new name for db for use by hmailserver.
MySQL is where the user, host, database permissions are.

Download/install the GUI tools/workbench it provides a graphical tool to manage the MySQL server.