Mysql DATA export Permissions
There are many ways to export mysql data, such as mysqldump, mysql-e 'SQL'> file, which can easily export data. However, when using a common user to export data, an error occurred.
1
|
Select * into outfile "file_path" from my_table |
The preceding statement is also a way for mysql to export data. When a common user executes a statement, the following error occurs:
1
|
ERROR 1045 (28000): Access denied for user 'my _ user' @ '%' (using password: YES) |
Previously, the user has been authorized on the corresponding database, as shown below:
1
|
Grant all on my_database. * to my_user; |
The preceding statement shows that all permissions have been granted to my_user, but the problem persists. Where is the problem? Google once found that mysql has a separate file permission, which must be granted separately. At the same time, file is a global permission and cannot only grant the file Permission of a single database to users. After finding the cause, we will grant the File Permission to the corresponding user:
1
|
Grant file on *. * to my_user; |
Execute the Export Statement again.
For more articles, goXiaopengxuan.