Mysql DATA export Permissions

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.