{"id":60649,"date":"2023-10-31T21:13:05","date_gmt":"2023-10-31T20:13:05","guid":{"rendered":"https:\/\/ekiwi-blog.de\/60649\/lazarus-mysql-error-libmysqldll-missing\/"},"modified":"2023-10-31T21:13:05","modified_gmt":"2023-10-31T20:13:05","slug":"lazarus-mysql-error-libmysqldll-missing","status":"publish","type":"post","link":"https:\/\/ekiwi-blog.de\/en\/60649\/lazarus-mysql-error-libmysqldll-missing\/","title":{"rendered":"Lazarus: MySQL error &#8220;libmysql.dll&#8221; missing"},"content":{"rendered":"<p>Access to MySQL databases with Lazarus.<\/p>\n<p><!--more--><\/p>\n<p>Today I played around a bit with Lazarus and wanted to access a MySQL database. A bit like before, just drag the components onto the form, configure and done? Unfortunately not quite. At runtime there was an error message:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_1.png\" alt=\"\" width=\"614\" height=\"140\" class=\"aligncenter size-full wp-image-60621\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_1.png 614w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_1-300x68.png 300w\" sizes=\"auto, (max-width: 614px) 100vw, 614px\" \/><\/p>\n<pre>\r\nCan not load default MySQL library (\"libmsysql.dll\" or \"libmysql.dll\"). Check your installation.\r\n<\/pre>\n<p>So here you still need a special DLL to access the database. But where do you get the DLL? The <a href=\"https:\/\/dev.mysql.com\/downloads\/mysql\/\" target=\"_blank\" rel=\"noopener\">download is available here<\/a>.<\/p>\n<p>The file can be found in the ZIP archive.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_2.png\" alt=\"\" width=\"958\" height=\"252\" class=\"aligncenter size-full wp-image-60625\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_2.png 958w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_2-300x79.png 300w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_2-768x202.png 768w\" sizes=\"auto, (max-width: 958px) 100vw, 958px\" \/><\/p>\n<p>It is important to download the appropriate version. Then add the DLL to the programme directory. In my case, the 5.7 version was the right one for now. Unfortunately, I still had problems with the new 8 version. I&#8217;ll have to test it when I get the chance.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_3.png\" alt=\"\" width=\"384\" height=\"198\" class=\"aligncenter size-full wp-image-60629\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_3.png 384w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_3-300x155.png 300w\" sizes=\"auto, (max-width: 384px) 100vw, 384px\" \/><\/p>\n<h2>Linux<\/h2>\n<p>As one would expect, there were also problems in Linux. The error message is similar here.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_4.png\" alt=\"\" width=\"706\" height=\"209\" class=\"aligncenter size-full wp-image-60633\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_4.png 706w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_4-300x89.png 300w\" sizes=\"auto, (max-width: 706px) 100vw, 706px\" \/><\/p>\n<pre>\r\nCan not load default MySQL library (\"libmysqlclient.so.20\" or \"libmysqlclient.so\").\r\n<\/pre>\n<p>So the same problem. So just copy the appropriate files? Unfortunately, that didn&#8217;t really work. First of all, we download the appropriate Linux version.<\/p>\n<p>Unlike Windows, Linux does not search for the library in the programme directory. This only brings us the same error message again.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_5.png\" alt=\"\" width=\"1309\" height=\"626\" class=\"aligncenter size-full wp-image-60637\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_5.png 1309w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_5-300x143.png 300w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_5-1024x490.png 1024w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_5-768x367.png 768w\" sizes=\"auto, (max-width: 1309px) 100vw, 1309px\" \/><\/p>\n<p>Instead, we copy the files (symlinks and library) into the \/usr\/lib directory. Afterwards, the application started without any problems.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_6.png\" alt=\"\" width=\"1287\" height=\"604\" class=\"aligncenter size-full wp-image-60641\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_6.png 1287w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_6-300x141.png 300w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_6-1024x481.png 1024w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/10\/mysql_6-768x360.png 768w\" sizes=\"auto, (max-width: 1287px) 100vw, 1287px\" \/><\/p>","protected":false},"excerpt":{"rendered":"<p>Access to MySQL databases with Lazarus.<\/p>\n","protected":false},"author":1,"featured_media":60645,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1555],"tags":[3384,1682,1700],"class_list":["post-60649","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-en","tag-lazarus-en","tag-linux-en","tag-programming"],"_links":{"self":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/60649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/comments?post=60649"}],"version-history":[{"count":0,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/60649\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media\/60645"}],"wp:attachment":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media?parent=60649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/categories?post=60649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/tags?post=60649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}