• ADADADADAD

    【Mysql】into outfile报错的问题[ mysql数据库 ]

    mysql数据库 时间:2024-12-24 19:11:44

    作者:文/会员上传

    简介:

    明明有select 权限却报错
    mysql> select * from server into outfile '/tmp/tt.txt';
    ERROR 1045 (28000): Access denied for user 'chenliang'@'%' (using password: YES)

    以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。

    明明有select 权限却报错
    mysql> select * from server into outfile '/tmp/tt.txt';
    ERROR 1045 (28000): Access denied for user 'chenliang'@'%' (using password: YES)

    百度后需要给file权限
    mysql> grant file on *.* to chenliang;
    Query OK, 0 rows affected (0.00 sec)


    再次导还是报错
    mysql> select * from server into outfile '/tmp/tt.txt';
    ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
    --这次错误不一样了,这个错误是一个参数导致的


    配置文件加入后重启
    secure_file_priv=''


    导出成功
    mysql> select * from server into outfile '/tmp/tt.txt';
    Query OK, 27 rows affected (0.00 sec)


    这个参数我以前在5.6.24版本都没调整过,可能默认值就是‘’,高版本默认值改成null,所以一定要注意
    【Mysql】into outfile报错的问题.docx

    将本文的Word文档下载到电脑

    推荐度:

    下载
    热门标签: mysql错的问题