MySQL Improperly Configured Reason: unsafe use of relative path

后端 未结 2 1000
时光说笑
时光说笑 2020-11-30 00:47

I\'m using Django, and when I run python manage.py runserver I receive the following error:

ImproperlyConfigured: Error loading MySQLdb module:         


        
2条回答
  •  一向
    一向 (楼主)
    2020-11-30 01:14

    In OS X El Capitan (10.11), Apple added System Integrity Protection.

    This prevents programs in protected locations like /usr from calling a shared library that uses a relative reference to another shared library. In the case of _mysql.so, it contains a relative reference to the shared library libmysqlclient.18.dylib.

    In the future, the shared library _mysql.so may be updated. Until then, you can force it to use an absolute reference via the install_name_tool utility.

    Assuming that libmysqlclient.18.dylib is in /usr/local/mysql/lib/, then run the command:

    sudo install_name_tool -change libmysqlclient.18.dylib \
      /usr/local/mysql/lib/libmysqlclient.18.dylib \
      /Library/Python/2.7/site-packages/_mysql.so
    

提交回复
热议问题