Maria DB and mysqlclient

Issues related to applications and software problems
Post Reply
CMW
Posts: 4
Joined: 2018/07/18 01:18:11

Maria DB and mysqlclient

Post by CMW » 2018/07/18 18:27:41

I have a C++ application currently running on a Fedora build, and my customer has expressed an interest in changing providers to a system running CentOS 7. I grabbed the latest basic install from the website and installed OS7 on my VMWare system so that I could test things out before confirming that I could move the software over. It's important to note that I am no where near a linux expert so if there is something more that you need, I would need what the specific commands to run to get that information. With that said... :)

The original system is based on MySQL and OS7 now comes with MariaDB, which has created some challenges. In the past when we tried a much older version of CentOS, our code would not compile do to some security restrictions but... who knows what OS7 will do.. Gotta try and see, right? Anyway, I grabbed all of "the latest" using the developers group, full 'everything' from Maria, g++, etc.

I have a "build.php" file that I run that is setup as follows:

Code: Select all

      #Your files to be compiled (.cpp only, seperated by space)#
	$files = "core.cpp roomsclass.cpp";

	#Library Directories (seperated by space)#
	$libs =  "-L/usr/lib64/mysql/ -L./ -lmysqlclient lib/liblua.a lib/liblualib.a";

	#Include Directories (seperated by space)#
	$incl = "-I/usr/include/mysql/ -Ilua/";
	
	system("g++ $files $incl $libs 2> build.log");
The original 'libs' was pointing to /usr/lib/mysql/ but it seems that OS7 has placed them into the lib64 folder so I updated it to that location. When I attempt to compile, I get the usual warnings about some depreciated state code (which never caused any problems in the past) and then at the end I get

Code: Select all

/usr/bin/ld: cannot find -lmysqlclient
collect2: error: ld returned 1 exit status
I do have files and folders in the "build" folder, which are carried over from the Fedora machine, which could possibly need updated, or perhaps I need to point the compiler to the system folders. I honestly don't know. It's been years since I've had to make any changes...

Any suggestions would be deeply appreciated. Thanks kindly in advance.

Gary

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: Maria DB and mysqlclient

Post by avij » 2018/07/18 18:59:05

Perhaps you need to install the mariadb-devel package.

CMW
Posts: 4
Joined: 2018/07/18 01:18:11

Re: Maria DB and mysqlclient

Post by CMW » 2018/07/19 18:01:41

"MariaDB-devel-10.3.8-1.el7.centos.x86_64 which is already installed"

yum group install "Development Tools" was done...

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: Maria DB and mysqlclient

Post by avij » 2018/07/19 18:18:03

That does not look like a CentOS-provided package. I have no idea if that contains the file you want or not.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Maria DB and mysqlclient

Post by TrevorH » 2018/07/19 18:21:23

I would suggest running yum provides '*/libmysqlclient.so*' and see which packages are listed and choose the one that matches your install best.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

CMW
Posts: 4
Joined: 2018/07/18 01:18:11

Re: Maria DB and mysqlclient

Post by CMW » 2018/07/19 22:10:11

For avij: Basic OS7 install, added webmin repository to install that (sorry for the haters, but it makes it easier for me to do things, being I am not that familiar with linux type commands... back in the day I rocked with msdos 3 but...)

For TrevorH: I ran that in putty, impressive list. Most had 'MariaDB-compat, followed by version numbers, all pointing to various releases of libmysqlclient.so files, all located in /usr/lib64. Those files exist in that location. These 2 were also listed:

1:mariadb-devel-5.5.56-2.el7.i686 : Files for development of MariaDB/MySQL : applications
Repo : base
Matched from:
Filename : /usr/lib/mysql/libmysqlclient.so

1:mariadb-libs-5.5.56-2.el7.i686 : The shared libraries required for : MariaDB/MySQL clients
Repo : base
Matched from:
Filename : /usr/lib/mysql/libmysqlclient.so.18.0.0
Filename : /usr/lib/mysql/libmysqlclient.so.18

I have no "mysql" folder in /usr/lib... and I am not quite sure how to get them and install them..

These are the packages listed in the package tree for 'maria'

MariaDB-client 10.3.8-1.el7.centos
MariaDB-common 10.3.8-1.el7.centos
MariaDB-compat 10.3.8-1.el7.centos
MariaDB-devel 10.3.8-1.el7.centos
MariaDB-server 10.3.8-1.el7.centos

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Maria DB and mysqlclient

Post by TrevorH » 2018/07/20 06:17:28

You'll need to ask whoever supplied those MariaDB packages that you're using.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

CMW
Posts: 4
Joined: 2018/07/18 01:18:11

Re: Maria DB and mysqlclient

Post by CMW » 2018/07/20 16:19:00

well, this is most strange. I installed from the same ISO image (1804) did a minimal configuration, added in older dependencies and dev tools for the install. Away it went. After it was all done, I ran yum update, which did its thing. I then stopped & disabled the firewalld, installed iptables, allowed ports 80 and 443, saved iptables, told it to start at boot.

I then put in httpd, started it, ran for boot.. tested, default welcome test page worked. I then installed mariadb, the default dependencies, started it, set at boot... then installed the devel package. Then I grabbed the base php, installed that, then installed the php-mysql files...

Copied over my c++ source files, libraries etc.. exactly as I did before on the other VM build. Went in using putty, as I always do, changed to the build folder and ran 'php build.php'.

It worked. I have no clue why it failed before on the first server VM I made... I used the bash history file from VM1 to do the same steps in VM2... so the only thing I can think of is there was a glitch in the VM1 install.

Anyway, the compile worked, so thats a good first step. I have lots more to do, install the database tables, setup the server folder for the lobby software, create some database users and permissions, and see if it will actually start. The final test will be to change over the windows client program to point to the VM machine and see if I can connect in. All of which of course, is beyond the scope of this post.

Thanks kindly for the patience and hand holding.

Gary

Post Reply