Problem installing MySQL with Linux

I have a strange problem installing MySQL on a Linux machine.

I was trying to configure MySQL as a back-end database to work on Airflow.
Below are my settings:

Operating System: Red Hat Enterprise Linux Server 7.7
python 3.7.2
anaconda 3
spark 2.45

I can connect to MySQL but I have an error executing the airflow initdb command. I'm not sure why this error occurs, but it certainly is only due to MySQL.


(2020-04-09 05:19:00,990) {} INFO - settings.configure_orm(): Using pool settings. pool_size=5, max_overflow=10, pool_recycle=1800, pid=15499
Traceback (most recent call last):
  File "/home/npa/anaconda3/envs/python3.7.6/bin/airflow", line 25, in 
    from airflow.configuration import conf
  File "/home/npa/anaconda3/envs/python3.7.6/lib/python3.7/site-packages/airflow/", line 47, in 
  File "/home/npa/anaconda3/envs/python3.7.6/lib/python3.7/site-packages/airflow/", line 377, in initialize
  File "/home/npa/anaconda3/envs/python3.7.6/lib/python3.7/site-packages/airflow/", line 266, in configure_orm
    engine = create_engine(SQL_ALCHEMY_CONN, **engine_args)
  File "/home/npa/anaconda3/envs/python3.7.6/lib/python3.7/site-packages/sqlalchemy/engine/", line 479, in create_engine
    return strategy.create(*args, **kwargs)
  File "/home/npa/anaconda3/envs/python3.7.6/lib/python3.7/site-packages/sqlalchemy/engine/", line 87, in create
    dbapi = dialect_cls.dbapi(**dbapi_args)
  File "/home/npa/anaconda3/envs/python3.7.6/lib/python3.7/site-packages/sqlalchemy/dialects/mysql/", line 118, in dbapi
    return __import__("MySQLdb")
  File "/home/npa/anaconda3/envs/python3.7.6/lib/python3.7/site-packages/MySQLdb/", line 18, in 
    import _mysql
ImportError: /home/npa/anaconda3/envs/python3.7.6/lib/python3.7/site-packages/ symbol mysql_real_escape_string_quote, version libmysqlclient_18 not defined in file with link time reference