The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mySQL Experts? Advice needed.

Discussion in 'General Discussion' started by purplepaws, May 11, 2003.

  1. purplepaws

    purplepaws Well-Known Member

    Joined:
    Jan 15, 2002
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    16
    Hi,

    We have a user that has suddenly not able to upload his text files into a mySQL database via myphpmanager.

    He is using LOAD DATA INFILE and it keeps coming up as access denied.

    Any ideas how I can fix this at all? We have already tried a number of suggestions from the mySQL manuals - but its still broken. As I say, it was working fine until arounf three weeks ago.
     
  2. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    To check if your users have this privilege, execute the mysql command line utility and do the following query:

    select user, file_priv from mysql.user;

    Also read the caveats regarding this privilege on the link above.
     
  3. purplepaws

    purplepaws Well-Known Member

    Joined:
    Jan 15, 2002
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    16
    Thanks for that info.

    I have run the command you suggested and it confirms that all users do NOT have this acess (except for root).

    How do, and should I, enable this access?

    As I say, I have read the mySQL manual and tried a couple of things. I have to admit, mySQL is an area i personally need to develop on :)
     
  4. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    If I'm not mistaken, it should be:

    GRANT FILE ON *.* TO username@localhost;
     
  5. purplepaws

    purplepaws Well-Known Member

    Joined:
    Jan 15, 2002
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    16
    Thanks again. Looks like thats changed the permission, so I will have him test.

    Cheers.
     
  6. JSD

    JSD Member

    Joined:
    Feb 19, 2003
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    purple,

    did you solved this problem?
     
  7. purplepaws

    purplepaws Well-Known Member

    Joined:
    Jan 15, 2002
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    16
    I havent exactly "solved" the problem, but I used the above method to allow the user to do what he needed.

    select user, file_priv from mysql.user; (Will show you if the user has the pivilidge or not)

    GRANT FILE ON *.* TO username@localhost; (To grant the user the rights if he hasnt got them)

    Thanks to Juanra for this one :)

    cPanel.net Support Ticket Number:
     
  8. JSD

    JSD Member

    Joined:
    Feb 19, 2003
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Thank purple

    cPanel.net Support Ticket Number:
     
  9. JeremyV

    JeremyV Well-Known Member

    Joined:
    Oct 20, 2002
    Messages:
    61
    Likes Received:
    0
    Trophy Points:
    6
    I'm encountering the same issue on my servers, and have been since upgrading to 4.0.12. What happens is a user tries to upload a .sql file via phpmyadmin... it says access denied. Strange.. I get a trouble ticket and even as root, it won't let me import the file, not in phpmyadmin OR command line.

    So I simply run /usr/bin/mysql_fix_privilege_tables

    Restart mysql

    All privileges are fixed and users can do what they should via control panel. But as soon as someone tries to import from an .sql file in phpmyadmin, it breaks it all over again.

    Funny thing is, even when the privileges are broken for importing data, users can still do everything else, such as add, edit, remove tables, databases, etc. But they just can't import data from a file.

    Is this a known bug with mysql or phpmyadmin? I haven't seen many others with this problem so it has me wondering.

    Here is the only other topic I see with the same problem.
    http://forums.cpanel.net/showthread.php?s=&threadid=9941

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page