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.

Database file permissions?

Discussion in 'General Discussion' started by danej, Apr 11, 2006.

  1. danej

    danej Active Member

    Joined:
    Dec 5, 2003
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    I'm trying to do the following query:

    /usr/local/bin/mysql -u <username> --host=127.0.0.1 -p<password> <database> -e "LOAD DATA INFILE '/path/<table>.sql' REPLACE INTO TABLE <table>"

    and I get:

    ERROR 1045 at line 1: Access denied for user: 'username@localhost' (Using password: NO)


    If I do

    /usr/local/bin/mysql -u <username> --host=127.0.0.1 -p<password> <database>

    then ...

    mysql> LOAD DATA INFILE '/path/<table>.sql' REPLACE INTO TABLE <table>;

    I still get:

    ERROR 1045: Access denied for user: 'username@localhost' (Using password: NO)


    Are there file permissions that I'm missing or something else?

    The goal is to do it in one statement in a shell script from an external server:

    ssh username@domain.com /usr/local/bin/mysql -u <username> --host=127.0.0.1 -p<password> <database> -e "LOAD DATA INFILE '/path/<table>.sql' REPLACE INTO TABLE <table>"

    thanks!
    dane
     
    #1 danej, Apr 11, 2006
    Last edited: Apr 13, 2006
  2. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    try it with --host=localhost
     
  3. danej

    danej Active Member

    Joined:
    Dec 5, 2003
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Same error

    Thanks for the idea, but I get the same error whether I use 127.0.0.1 or localhost.

    Also, the username supllied has full access to the databse, and it doesn't change the error if I chmod the .sql files either.

    Dane
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    If you have root access it might be simply to just use:

    mysql <database> -e "LOAD DATA INFILE '/path/<table>.sql' REPLACE INTO TABLE <table>"

    Or if the SQL file has all the correct statements:

    mysql <database> < /path/<table>.sql
     
  5. danej

    danej Active Member

    Joined:
    Dec 5, 2003
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    no root

    The script will not have root access.

    I have searched mysql.com for what access is required, but I'm not able to find it.

    Any other ideas?

    The file is just a csv of the data for the table, it is not the structure or insert statements.

    Thanks,
    Dane
     
  6. danej

    danej Active Member

    Joined:
    Dec 5, 2003
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    bump

    bump .....

    Any other ideas?
     
Loading...

Share This Page