There are many ways to export MySQL data, such as mysqldump, mysql-e ' sql ' > file, which can be easily exported, but there is a problem when exporting data with ordinary users.
1
|
Select * into outfile ' File_path ' from my_table |
The above statement is also a way for MySQL to export data, when the use of ordinary users to execute the statement, an error occurred:
1
|
ERROR1045(28000): Access denied forUser' My_user '@'% '(Using Password:yes) |
The user has previously been granted authorization on the corresponding database, as follows:
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 come from? Google after a while found that MySQL has a separate file permissions, need to be given separately, and file is a global permission, can not just give a single database file permissions to the user. After the reason is found, the file permissions are assigned to the appropriate user:
1
|
Grant file on *. * to My_user; |
Executes the export statement again and executes successfully.
For more articles, please visit the little Fat Xuan .
MySQL Data export permissions issue