How to fix missing OpenSSL library for MySQL after brew upgrade? - mysql

I upgraded MySQL (and a slew of other packages) using the ever-so dangerous brew update && brew upgrade
After the upgrade, I started getting a database connection error in the browser and then realized the OpenSSL library is now missing
My initial thought was to force uninstall OpenSSL and re-install the version MySQL is looking for, but there's quite a few packages depending on the current version.
Error
chris$ mysql -v
dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/bin/mysql
Reason: image not found
OpenSSL
Attempt to brew uninstall openssl (with intention of re-reinstalling 1.0)

Try to switch back:
brew switch openssl 1.0.2t
Helped for me.

Related

Problems installing MySQL 5.7 properly on fresh CentOS 7 install

I admit that I am new to back-end work in general and I seem to be stuck (for several hours) following through with completing the setting up process for Magento 2.3
I was following https://devdocs.magento.com/guides/v2.3/install-gde/prereq/mysql.html for my commands but to no success.
I managed to get the following installed:
Cent OS 7 (x86_64)
Apache 2.4.6
PHP 7.2.14 (all the extensions installed passed the Setup Wizard readiness check)
I used these commands to install MySQL 5.7 Community Release: (from the documentation)
wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
yum -y install mysql mysql-server
yum -y install mysql-community-server
To check if my installation went well, when I run:
mysql --version
I received an error message saying:
-bash: /usr/bin/mysql: No such file or directory
I know that there is something I definitely am missing out completely. When I try to start the MySQL service using the command:
systemctl start mysqld
I get the resulting error message:
Failed to start mysqld.service: Unit not found.
Any suggestions will much be appreciated. Thank you in advance.
Maybe it installed it as mariadb?
systemctl start mariadb
After removing MySQL 5.7 community release from my Cent OS, I decided to install MariaDB.
Inside the directory /etc/yum.repos.d/ I've created a file called MariaDB.repo and added this into the file:
# MariaDB 10.3 CentOS repository list - created 2019-01-25 05:36 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
I then performed the command in my terminal window:
sudo yum install MariaDB-server MariaDB-client
Because of this, mysql --version and systemctl start mysql works like a charm. Thanks #greenberet123 and #danblack for the suggestion.

dyld: Library not loaded: /usr/local/opt/unixodbc/lib/libodbc.2.dylib

I am facing the following issue on Mac when I run rake ts:index for Thinking Sphinx indexing:
dyld: Library not loaded: /usr/local/opt/unixodbc/lib/libodbc.2.dylib
I am using mysql version 8.0.13 for osx10.13 on x86_64.
How can I resolve this issue?
Insalling unixodbc on Mac resolved this for me.
brew install unixodbc
In addition to
brew install unixodbc
you can also install the mssql drivers after this with the following brew instructions:
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update
brew install msodbcsql mssql-tools
After this I was able to use "ODBC Driver 17 for SQL Server" in python.

django runserver giving error for libmysqlclient_18 not defined in file libmysqlclient.so.18

on running django-server with django==1.9 and pgsql 9.5, virtualenv=15.0.9 with python2.7 installation no-wheel no-site-packages on ubuntu 14.04
no previous mysql installation prior mariadb==10.2 after which this error occured. tried purging mariadb then, installing mysql=5.6 from dpkg but it didn't solved it either, then reinstalled mariadb==10.2 for sudo apt-get install libmariadbclient but it didn't solved it either.
Any help would be appreciated, ....
getting the below error
Solved.
a gis plugin was being used in my project postgis and postgres used in project.
for that the very initial postgres installation must have put libmysqlclient_18 version defined by its own customizations.
after mariadb installation, the libmysqlclient.so.18 should have been updated, hindering the older linkage and setups.
ran the mysql/mariadb cleaning with this post
https://askubuntu.com/a/172516/735971
installed mariadb again, got the gis support and issue is resolved.
link to gis support libraries:
http://scigeo.org/articles/howto-install-latest-geospatial-software-on-linux.html
update:
got another error during running django server with postgresql==9.5 and postgis==2.2
Could not find the GEOS library (tried "geos_c", "GEOS"). Try setting GEOS_LIBRARY_PATH in your settings.
traced to evidence that mariadb-common files and libmysqlclient/libmariadblclient was still cached in apt-get
evertime I installed postgresql or any of its extension now, it used the cached copy of libmysqlclient.so.18 from mariadb.
so I removed all the unused dpkg configs
sudo dpkg --purgeCOLUMNS=300 dpkg -l "" | egrep "^rc" | cut -d\ -f3
CAUTION: it can remove all the unused package, for only mariadb related files you can do
sudo dpkg --purgeCOLUMNS=300 dpkg -l "maria" | egrep "^rc" | cut -d\ -f3
Also removed postgresql for the next clean installation overriding any traces of compiled libmysqlclient if any.
then removed any apt-repo related to mariadb from /etc/apt/sources.list followed by sudo apt-get update.
then apt-get autoremove and apt-get clean to clean everything.
then sudo apt-get install -y postgresql-9.5 postgresql-9.5-postgis-2.2 postgresql-9.5-pgrouting postgresql-contrib-9.5
but i must say mariadb V10.2 still clashes with other installations and system libraries like it clashed in prior versions for libmysqlclient.so

Create a symlink for the libmysqlclient.18.dylib library

I have installed mysql through a pkg installer.
I am trying to start rails server and I am getting the following error.
Library not loaded: libmysqlclient.18.dylib (LoadError)
I am reading that a solution to that is to create a symlink like
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
There is no
/usr/local/mysql/lib/libmysqlclient.18.dylib
file only a
/usr/local/mysql/lib/libmysqlclient.20.dylib file.
I run
sudo find /usr/ -name libmysqlclient.18.dylib
and I can't find the libmysqlclient.18.dylib file.
I encountered a problem like this while setting up a new development environment. I had installed MySQL via homebrew, which gave me version 5.7.9 of MySQL, with the library version libmysqlclient.20.dylib.
In my case, I was setting up a python project. The requirements install failed because the python-MySQL connection piece was looking for libmysqlclient.18.dylib, which was nowhere to be found on my machine.
Downgrading to MySQL 5.6 solved the issue for me:
brew uninstall mysql
brew tap caskroom/versions
brew install mysql56
Now /usr/local/lib/libmysqlclient.18.dylib is present and everything's peachy.
The mysql2 gem which is most likely in your Rails environment is still looking for libmysqlclient.18.dylib (from what must have been a previous mysql install) but the library is no longer there because the recent manual install/upgrade replaced it with libmysqlclient.20.dylib.
The easy fix is to install again mysql2:
gem uninstall mysql2 && gem install mysql2
or better yet:
gem uninstall mysql2 && bundle, if you are on Bundler.
I did not have mysql installed through brew or gem, and was facing the same issue that it was looking for libmysqlclient.18.dylib instead of libmysqlclient.20.dylib. I tried everything mentioned here and at some other threads. Nothing worked. Finally, this worked for me:
pip install mysqlclient
It does not install libmysqlclient.18.dylib, but solves the library not installed and image not found errors.
Hope it helps someone!
Uninstall mysqlclient
Clear cache of your pip
Find folder in which pip wheel cache is stored for mysqlclient and delete it.
Reinstall mysqlclient
mac mojave OS cache will be in this folder: ~/Library/Caches/pip. Follow the steps below:
Find ~/Library/Caches/pips/wheels/ | grep mysql
Delete the file you got.
pip install mysqlclient

Problems with install mysql 5.5.20 with homebrew

I installed homebrew and Xcode 4.3.2 with command line tools on Mac Osx Lion and when I now try to install mysql with :
brew install mysql -v
I get the error :
Error: #<BuildError: Failed executing: cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/mysql/5.5.20 -DMYSQL_DATADIR=/usr/local/var/mysql -DINSTALL_MANDIR=/usr/local/Cellar/mysql/5.5.20/share/man -DINSTALL_DOCDIR=/usr/local/Cellar/mysql/5.5.20/share/doc/mysql -DINSTALL_INFODIR=/usr/local/Cellar/mysql/5.5.20/share/info -DINSTALL_MYSQLSHAREDIR=share/mysql -DWITH_SSL=yes -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DSYSCONFDIR=/usr/local/etc -DWITH_UNIT_TESTS=OFF -DWITH_READLINE=yes>
Here you find the full log :
https://gist.github.com/2421381
I checked the logs but there is nothing that can help me for the moment. Brew doctor is also clean and give no errors.
Found the solution with thanks to a reply of visoft on my gist post. This solution worked for me. The problem is coming from Cmake, I need version 2.8.7 instead of 2.8.8, run this code to get it work :
cd /usr/local
brew uninstall cmake
git checkout 948c2769 Library/Formula/cmake.rb
brew install mysql
After this, mysql was installed successfully.