[英]Lazarus console app can't connect to mysql - ubuntu
I have one console app in Lazarus and my OS is Ubuntu 16.04. 我在Lazarus中有一个控制台应用程序,我的操作系统是Ubuntu 16.04。 I can connect to db in Lazarus IDE.
我可以在Lazarus IDE中连接到数据库。 But when I try to connect to database in my console app my exeption is :
但是,当我尝试在控制台应用程序中连接数据库时,我的表现是:
Can not load default MySQL library ("libmysqlclient.so.18" or "libmysqlclient.so"). Check your installation.
Why I can't connect in console app but in IDE I can ? 为什么我不能在控制台应用程序中连接,但在IDE中可以连接? How can I solve this problem?
我怎么解决这个问题?
First add: 首先添加:
{$LinkLib libmysqlclient.so}
and find the mysql or mariadb version client lib and copy to folder project or /usr/libs/libmysqlclient.so.xx
xx is version 并找到mysql或mariadb版本的客户端lib并复制到文件夹project或
/usr/libs/libmysqlclient.so.xx
xx是版本
I'm Add : 我添加:
{$LinkLib libmysqlclient.so}
after uses then : 使用后则:
copy libmysqlclient.so
by this name /usr/lib/libmysqlclient.so.18
. 用
/usr/lib/libmysqlclient.so.18
复制libmysqlclient.so
。
It's done. 完成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.