Previous Thread
Next Thread
Print Thread
MySQL unable to load library #37065 06 Feb 24 10:52 PM
Joined: Nov 2006
Posts: 2,223
S
Stephen Funkhouser Offline OP
Member
OP Offline
Member
S
Joined: Nov 2006
Posts: 2,223
I'm unable to use MySQL with A-Shell EL7 version 7.0.1754.3/64. I'm not sure if this library needs to be compiled as a 64-bit library, but it's the only one I didn't find and x86_64 version of.

Not working with the latest libashmysql.so.1.6.149.el7 or 1.5.145


Seeing this on the main window. This was also the only related message in ashlog.log

Code
@%Unable to load
   libashmysql.so.1: cannot open shared object file: No such file or directory


Here's the usual output to verify the library is setup correctly.
Code
[root@vmware-kk-vagrant ansible]# ls -l /usr/lib/libash*
lrwxrwxrwx 1 root root 62 Feb  6 14:26 /usr/lib/libashmysql.so.1 -> /var/data/kkvet/ashell/vm/miame/bin/libashmysql.so.1.6.149.el7
lrwxrwxrwx 1 root root 68 Feb  6 14:26 /usr/lib/libashnet.so.1 -> /var/data/kkvet/ashell/vm/miame/bin/libashnet.so.1.14.191-el7-x86_64
lrwxrwxrwx 1 root root 67 Feb  6 14:26 /usr/lib/libashtls.so.1 -> /var/data/kkvet/ashell/vm/miame/bin/libashtls.so.1.3.217-el7-x86_64
[root@vmware-kk-vagrant ansible]# ldd /usr/lib/libashmysql.so.1
        linux-gate.so.1 =>  (0xf7775000)
        libc.so.6 => /lib/libc.so.6 (0xf7594000)
        libmysqlclient.so.20 => /usr/lib/mysql/libmysqlclient.so.20 (0xf6e70000)
        /lib/ld-linux.so.2 (0xf7776000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xf6e55000)
        libdl.so.2 => /lib/libdl.so.2 (0xf6e50000)
        librt.so.1 => /lib/librt.so.1 (0xf6e46000)
        libstdc++.so.6 => /lib/libstdc++.so.6 (0xf6d5a000)
        libm.so.6 => /lib/libm.so.6 (0xf6d18000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xf6cfd000)


The MySQL client version is
Code
[root@vmware-kk-vagrant ansible]# mysql --version
mysql  Ver 14.14 Distrib 5.7.44, for Linux (i686) using  EditLine wrapper
[root@vmware-kk-vagrant ansible]#


Last edited by Stephen Funkhouser; 06 Feb 24 10:57 PM.

Stephen Funkhouser
Diversified Data Solutions
Re: MySQL unable to load library [Re: Stephen Funkhouser] #37066 06 Feb 24 10:54 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
Ok, let me try to reproduce the issue here.

Re: MySQL unable to load library [Re: Stephen Funkhouser] #37067 06 Feb 24 11:55 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
Ok, we've got a couple of potential issues:

1) Although I think I included the libashmysql connector in the latest bin (complete install package), I failed to post it separately. That's resolved here:

libashmysql8.so.1.6.148-el7-x86_64.tz

2) I couldn't find a mysql client connector package for MySQL 7, so you'll need to use the version 8 connector (although I think it works fine with MySQL database servers).

Here are the packages I ended up installing:
Code
[root@ashxmpp bin64]# rpm -aq | grep mysql
pcp-pmda-mysql-3.10.6-2.el7.x86_64
mysql-community-libs-8.0.35-1.el7.x86_64
mysql-community-client-8.0.35-1.el7.i686
mysql80-community-release-el7-7.noarch
mysql-community-common-8.0.35-1.el7.i686
mysql-community-common-8.0.35-1.el7.x86_64
mysql-community-client-8.0.35-1.el7.x86_64

And here's what the linkage looks like:
Code
lrwxrwxrwx 1 root root      20 Jan 23 12:06 /usr/lib64/mysql/libmysqlclient.so -> libmysqlclient.so.21
lrwxrwxrwx 1 root root      25 Dec 24 15:33 /usr/lib64/mysql/libmysqlclient.so.21 -> libmysqlclient.so.21.2.35
-rwxr-xr-x 1 root root 7545032 Oct 12 08:33 /usr/lib64/mysql/libmysqlclient.so.21.2.35

Code
[root@ashxmpp bin64]# ls -l /usr/lib64/libashmysql.so.1
lrwxrwxrwx 1 root root 54 Jan 25 15:39 /usr/lib64/libashmysql.so.1 -> /vm/miame/bin64/libashmysql8.so.1.6.148-el7-x86_64

Code
[root@ashxmpp bin64]# ldd /usr/lib64/libashmysql.so.1
        linux-vdso.so.1 =>  (0x00007ffdcfe5f000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f381faff000)
        libmysqlclient.so.21 => /usr/lib64/mysql/libmysqlclient.so.21 (0x00007f3
81f3cf000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f38200f3000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f381f1b2000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f381efae000)
        libssl.so.10 => /lib64/libssl.so.10 (0x00007f381ed3c000)
        libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007f381e8d8000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f381e6be000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f381e4b6000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f381e1ad000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f381deab000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f381dc95000)
        libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f381da47000)
        libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f381d75e000)
        libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f381d55a000)
        libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f381d326000)
        libz.so.1 => /lib64/libz.so.1 (0x00007f381d110000)
        libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f381ceff000)
        libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f381ccfb000)
        libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f381cad5000)
        libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f381c874000)
        liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f381c64f000)

Here's how it shows up in the SQL:SQLTEST1 program:
Code
SQLTEST1 - Verify existence of A-Shell/SQL connector and database client library

Warning: Minimum connector version for this A-Shell version is 1.3
(Earlier connectors may be too incompatible to even report their version)

Select database connector (1=MySQL,2=ODBC) [1] 1

Using connector MySQL (native)
Loading connector and client library...
 [Setting SQLCONF_TRACE]
 [OK]
Initializing connection handle...       [OK]
Client database library version:        8.0.35

A-Shell/SQL connector and DBMS client library successfully loaded

Connector ID (lib name)                 LIBASHMYSQL
Connector Version                       1601480 (1.6.148.0)
Connector Description:                  MySQL 8.0 (native)

Re: MySQL unable to load library [Re: Stephen Funkhouser] #37068 07 Feb 24 01:14 AM
Joined: Nov 2006
Posts: 2,223
S
Stephen Funkhouser Offline OP
Member
OP Offline
Member
S
Joined: Nov 2006
Posts: 2,223
I'm not saying we won't switch to the MySQL 8 client libraries, but it is easy to enable them in yum repo file /etc/yum.repos.d/mysql-community.repo. You just set all of the 8.0 repos to enabled=0 and the rest to enabled=1.

Code
[root@vmware-kk-vagrant ansible]# cat /etc/yum.repos.d/mysql-community.repo
# Enable to use MySQL 5.7
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch
enabled = 1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql80-community]
name=MySQL 8.0 Community Server
baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/7/$basearch
enabled = 0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-connectors-community]
name=MySQL Connectors Community
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/7/$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-tools-community]
name=MySQL Tools Community
baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/7/$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-tools-preview]
name=MySQL Tools Preview
baseurl=http://repo.mysql.com/yum/mysql-tools-preview/el/7/$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-cluster-7.5-community]
name=MySQL Cluster 7.5 Community
baseurl=http://repo.mysql.com/yum/mysql-cluster-7.5-community/el/7/$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-cluster-7.6-community]
name=MySQL Cluster 7.6 Community
baseurl=http://repo.mysql.com/yum/mysql-cluster-7.6-community/el/7/$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-cluster-8.0-community]
name=MySQL Cluster 8.0 Community
baseurl=http://repo.mysql.com/yum/mysql-cluster-8.0-community/el/7/$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql



Stephen Funkhouser
Diversified Data Solutions
Re: MySQL unable to load library [Re: Stephen Funkhouser] #37072 07 Feb 24 06:06 PM
Joined: Nov 2006
Posts: 2,223
S
Stephen Funkhouser Offline OP
Member
OP Offline
Member
S
Joined: Nov 2006
Posts: 2,223
This is going to take longer to test moving to MySQL 8 because I have add removal/unistalll of MYSQL 5.7 client and installing MySQL 8 client to our configuration management.


Stephen Funkhouser
Diversified Data Solutions
Re: MySQL unable to load library [Re: Stephen Funkhouser] #37073 07 Feb 24 06:14 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
I was just trying your recipe here and coming to a similar conclusion, i.e. that version 8 needs to be uninstalled before 5.7 will work. Here's what I see when trying to update the client (i.e. it still wants to stick with the 8.0 versions even after disabling them in the repo) ...

Code
# yum install mysql-community-client.x86_64
...

 Package                         Arch    Version       Repository          Size
================================================================================

Updating:
 mysql-community-client          x86_64  8.0.36-1.el7  mysql80-community   16 M
Updating for dependencies:
 mysql-community-client          i686    8.0.36-1.el7  mysql80-community   16 M
 mysql-community-client-plugins  x86_64  8.0.36-1.el7  mysql80-community  3.5 M
 mysql-community-libs            i686    8.0.36-1.el7  mysql80-community  1.5 M
 mysql-community-libs            x86_64  8.0.36-1.el7  mysql80-community  1.5 M

Transaction Summary
================================================================================

Upgrade  1 Package (+4 Dependent packages)

There was already a fair amount of thrashing / incompatibilities to overcome in the development files going from the original i686 5.7 set to the x86_64 8.0, so I'm not sure I want to wage that fight again. Might be simpler to create an entire new VM to keep the two environments separate.

Re: MySQL unable to load library [Re: Stephen Funkhouser] #37081 09 Feb 24 01:01 AM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
Ok, I managed to create the 5.7 version of the 64 bit connector by uninstalling all of the 8.0 and 32 bit pieces and starting over. Hopefully this works for you (and that your existing libmysqlclient is compatible) ...

libashmysql.so.1.6.149-el7-x86_64.tz

Code
[root@ashxmpp bin64]#  ls -l /usr/lib64/mysql/libmysqlclient.so.*
lrwxrwxrwx 1 root root       25 Feb  8 16:23 /usr/lib64/mysql/libmysqlclient.so.20 -> libmysqlclient.so.20.3.31
-rwxr-xr-x 1 root root 11701320 Oct 11 05:09 /usr/lib64/mysql/libmysqlclient.so.20.3.31

Code
[root@ashxmpp bin64]# ls -l /usr/lib64/libashmysql*
lrwxrwxrwx 1 root root 58 Feb  8 16:39 /usr/lib64/libashmysql.so.1 -> /vm/miame/bin64/libashmysql.so.1.6.149-el7-x86_64

When creating the links manually, don't forget that the 64 bit libashmysql.so.1 link is expected to be in /usr/lib64, and the target should be in bin64 to keep it (and all the other A-Shell/64 libraries and executables) separate from the 32 bit versions in bin.
Code
[root@ashxmpp bin64]# ldd libashmysql.so.1.6.149-el7-x86_64
        linux-vdso.so.1 =>  (0x00007fff19ff0000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f91c49f5000)
        libmysqlclient.so.20 => /usr/lib64/mysql/libmysqlclient.so.20 (0x00007f91c4051000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f91c4fe9000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f91c3e34000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f91c3c30000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f91c3a28000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f91c371f000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f91c341d000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f91c3207000)

Code
.ver
              -- A-Shell 7.0.1754.3/64 Up and Running --
.run sqltst1
...
Select database connector (1=MySQL,2=ODBC) [1] 1

Using connector MySQL (native)
Loading connector and client library... [OK]
Initializing connection handle...       [OK]
Client database library version:        5.7.44

A-Shell/SQL connector and DBMS client library successfully loaded

Connector ID (lib name)                 LIBASHMYSQL
Connector Version                       1601490 (1.6.149.0)
Connector Description:                  MySQL 5.7 (native)

Re: MySQL unable to load library [Re: Stephen Funkhouser] #37084 09 Feb 24 03:51 PM
Joined: Nov 2006
Posts: 2,223
S
Stephen Funkhouser Offline OP
Member
OP Offline
Member
S
Joined: Nov 2006
Posts: 2,223
This solves the problem.

Here are a couple of notes for other would-be upgraders.

One, you have to yum install the 64-bit MySQL client. We only had the 32-bit installed. "yum install mysql-community-client"

Two, the 64-bit library symlinks have to be in /usr/lib64/


Stephen Funkhouser
Diversified Data Solutions
Re: MySQL unable to load library [Re: Stephen Funkhouser] #37085 09 Feb 24 04:39 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
Glad to hear that. Although I have a question about your experience with installing the 64 bit MySQL client. Are you saying that "yum install mysql-community-client" installed the 64 bit client even though you already had the 32 bit client installed? I thought I ran into a conficting-packages problem trying that, although my problem may have been complicated by the existence of MySQL 8.0 components and/or other mysql-related packages already installed.

I ended up uninstalling all of the MySQL stuff and then more-or-less following the Step 1 this web page how-to-install-mysql-on-centos-7 (minus the server installation, which I didn't need because I was connecting to an already existing server across a network).

Re: MySQL unable to load library [Re: Stephen Funkhouser] #37087 09 Feb 24 05:22 PM
Joined: Nov 2006
Posts: 2,223
S
Stephen Funkhouser Offline OP
Member
OP Offline
Member
S
Joined: Nov 2006
Posts: 2,223
We had previously only installed the 32-bit version of the client. "yum install mysql-community-client.i686" 64-bit mode is the default in EL7 so you don't have to reference the architecture for 64-bit yum packages. You could use mysql-community-client.x86_64 to specify 64-bit.

It seems pretty likely having installed MySQL 8.0 components was the root of your problem. I think the names of the packages in both repos collide because they use "mysql-community-client" in either case. Not differentiating the version in the package name. So, those repos are incompatible with having packages installed at the same time.


Stephen Funkhouser
Diversified Data Solutions

Moderated by  Jack McGregor, Ty Griffin 

Powered by UBB.threads™ PHP Forum Software 7.7.3