Where does mysql_ssl_rsa_setup get OpenSSL files?

假如想象 提交于 2019-12-12 05:19:00

问题


Getting "openssl not installed on this system" when running mysql_ssl_rsa_setup.

I installed openssl and mysql from source, both times keeping the default paths for installation (/usr/local/openssl for openssl [I actually renamed it to openssl from ssl to see if that was the problem], /usr/local/mysql for mysql).

The docs say it gets the path from the PATH environment variable, but there's no option to specify it in the command line. What is the default? How to change it? I have seen that you can modify /etc/environment to add PATH there, but the file is empty by default.


回答1:


According to 4.4.5 mysql_ssl_rsa_setup — Create SSL/RSA Files, mysql_ssl_rsa_setup uses the openssl command line tool:

Note

mysql_ssl_rsa_setup uses the openssl command, so its use is contingent on having OpenSSL installed on your machine.


What is the default?

OpenSSL's default installation location is /usr/local/ssl


How to change it?

Use --openssldir when you configure the library. Also see Compilation and Installation on the OpenSSL wiki.


You should not install OpenSSL in /usr/bin (and the libraries in /usr/lib). Its creates too many problems.

Instead, let the library install itself in /usr/local/ssl. Then you should be able to create a shell script located at /usr/local/bin/openssl that performs the following:

$ cat /usr/local/bin/openssl
#!/usr/bin/env bash

LD_LIBRARY_PATH=/usr/local/ssl/lib:$LD_LIBRARY_PATH; /usr/local/ssl/bin/openssl "$@"

Be sure to chmod a+x /usr/local/bin/openssl.


You can verify the OpenSSL tool being used with:

$ which openssl
/usr/local/bin/openssl

If needed, add /usr/local/bin to your PATH:

$ cat ~/.bash_profile
export PS1="\\h:\\W$ "
export UMASK=0022
export EDITOR=emacs

export PATH="/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin"
...


来源:https://stackoverflow.com/questions/35833877/where-does-mysql-ssl-rsa-setup-get-openssl-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!