Questions? Feedback? powered by Olark live chat software
Knowledgebase
Author Avatar

MariaDB Client Setup on CentOS 7.x Container for Elastic VPS

Written by: on 14 March 2025 08:20 PM 14 March 2025 08:20 PM

Scenario: You have got an Elastic VPS running CentOS 7.9 or lower running. You also have a MySQL Container running the latest version of MySQL or MariaDB. When you try to connect to MySQL/MariaDB Server internally via SSH or via code from the Elastic VPS, you cannot connect to it due to ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory... or something similar... You will need to complete the following steps:

  1. Add the MariaDB Repo file for yum repo by creating /etc/yum.repos.d/mariadb.repo and placing the following content in to the mariadb.repo file:

    1 [mariadb]
    2 name = MariaDB-11.8.1
    3 baseurl= http://archive.mariadb.org/mariadb-11.8.1/yum/centos/$releasever/$basearch
    4 gpgkey= https://archive.mariadb.org/PublicKey
    5 gpgcheck=1
  2. Run 'yum clear cache' and then 'yum makecache'
  3. Once completed you can run 'yum install MariaDB-Client-11.6*'
  4. Once installed I ran the following command to connect to Sample DB I created:

    /usr/bin/mariadb -u sampledb_usr -p -h 10.x.x.x--ssl=0

Should you have any further issues, please reach out to our support team for assistance.