pam mysql编译安装_linux下编译安装MariaDB 10.4.7,解决错误:cannot access ‘/auth_pam_tool_dir’: No such file or dire...

在编译安装MariaDB 10.4.7过程中遇到错误:'chown: cannot access '/auth_pam_tool_dir': No such file or directory'。通过修改mysql_install_db文件,在323行附近为builddir赋值,363行附近将pamtooldir设为 './plugin/auth_pam',然后在源码目录下执行安装命令,成功解决该问题。
摘要由CSDN通过智能技术生成

编译安装MariaDB 10.4.7,前面的步骤我就不复述了,一切正常没什么问题。

当执行到:scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql --user=mysql,这时系统提示以下错误:

chown: cannot access ‘/auth_pam_tool_dir’: No such file or directory

Cannot change ownership of the '/auth_pam_tool_dir' directory

to the 'mysql' user. Check that you have the necessary permissions and try again.

又是百度又是google的,半天也没解决问题,最后研究了代码,才有了下面的解决方案:

1、可以切换到源码目录,例如:/data/mariadb-10.4.7

cd /data/mariadb-10.4.7

2、修改 mysql_install_db 文件:

vim /data/mariadb-10.4.7/scripts/mysql_install_db

在 323 行附近,找到代码:

# Configure paths to support files

if test -n "$srcdir"

then

......

部分,在下面增加为变量 builddir 赋值,结果如下:

builddir='/data/mariadb-10.4.7' #******* 赋值 *******

basedir="$builddir"

bindir="$basedir/client"

resolveip="$basedir/extra/resolveip"

3、继续向下,在 363 行附近,找到代码:

plugindir=`find_in_dirs --dir auth_pam.so $basedir/lib*/plugin $basedir/lib*/mysql/plugin`

pamtooldir=$plugindir #***** 就是这行 ******

# relative from where the script was run for a relocatable install

elif test -n "$dirname0" -a -x "$rel_mysqld" -a ! "$rel_mysqld" -ef "./bin/mysqld"

我们在 pamtooldir=$plugindir 一行的下面,增加新行,覆盖原先的值,结果为:

plugindir=`find_in_dirs --dir auth_pam.so $basedir/lib*/plugin $basedir/lib*/mysql/plugin`

pamtooldir=$plugindir

pamtooldir='./plugin/auth_pam' #******* 新增行 *******

# relative from where the script was run for a relocatable install

elif test -n "$dirname0" -a -x "$rel_mysqld" -a ! "$rel_mysqld" -ef "./bin/mysqld"

保存,退出。

4、确定当前是在源码目录下,即:/data/mariadb-10.4.7/ ,直接执行命,就OK了。

./scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql --user=mysql #参数 --basedir 和 --datadir ,自行设定,照抄我的不一定好使~

破饭,收摊。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值