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
这里都有什么设置呢
secure_file_priv
为null 表示不允许导入导出secure_file_priv
指定文件夹时,表示mysql的导入导出只能发生在指定的文件夹secure_file_priv
没有设置时,则表示没有任何限制
通过mysql的配置文件my.ini
可以修改其值。在my.ini
文件中按照第三种方式设置
重启MySQL服务,再次运行备份语句,成功!