MySQL Data export permissions issue

Source: Internet
Author: User

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

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.