MySQL问题总结(持续更新)

1.添加新用户

准备创建一个新用户的时候报错了

create user 'username'@'%' identified by 'password';  

The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
解决方法:
先刷新一下权限表再重新执行即可

flush privileges;
create user 'username'@'%' identified by 'password';  
2.备份数据表

准备备份一个数据表的时候报错了

select * into outfile 'D:/my_student.csv' from my_student;

The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
解决方法:

show variables like '%secure%';   -- 利用该语句查看secure-file-priv 的值

在这里插入图片描述
secure-file-priv的值是NULL,那么secure_file_priv这里都有什么设置呢

  1. secure_file_priv为null 表示不允许导入导出
  2. secure_file_priv指定文件夹时,表示mysql的导入导出只能发生在指定的文件夹
  3. secure_file_priv没有设置时,则表示没有任何限制

通过mysql的配置文件my.ini可以修改其值。在my.ini文件中按照第三种方式设置
在这里插入图片描述

重启MySQL服务,再次运行备份语句,成功!

发布了19 篇原创文章 · 获赞 20 · 访问量 9542

猜你喜欢

转载自blog.csdn.net/qq_39323164/article/details/104134732
今日推荐