MySQL data is exported in a very large number of ways, such as mysqldump, mysql-e ' sql ' > file, which can be very convenient to export data, but when the use of ordinary users to export data, there is a problem.
1
|
Select * into outfile ' File_path ' from my_table |
The above statement is also a way for MySQL to export data when running a statement with a normal user. A bit of an error occurred:
1
|
ERROR1045(28000): Access denied forUser' My_user '@'% '(Using Password:yes) |
Authorization has been previously run on the appropriate database for that user, such as the following:
1 |
grant all on My_database.* to my_user; |
As you can see from the above statement, all permissions have been given to my_user, but the problem persists.
Where does the problem really go now? Google a bit later found that MySQL has a separate file permissions, need to be given separately, the same time file is a global permission. You cannot assign only the file permissions of a single database to a user.
After finding the cause. The file permissions are assigned to the corresponding user as follows:
1
|
Grant file on *. * to My_user; |
Run the export statement again. Run successfully.
a lot of other articles please go to the little Fat Xuan .
MySQL Data export permissions issue