Loading data from a text file into mysql

Discussion in 'Databases' started by destino, Jun 23, 2013.

  1. Greetings.

    I am having some issues with loading data into a MYSQL table from a csv file.

    The table exists and the data is I believe in the correct format. The .csv file is on the server and located as /home/interval/names.csv.

    This is the code that I have attempted.

    LOAD DATA INFILE '/home/interval/names.csv'
    INTO TABLE testdatabase
    FIELDS TERMINATED BY ','
    LINES TERMINATED BY '\n'

    I get the following error message.
    Error Code: 1045. Access denied for user 'username'@'%' (using password: YES)

    I have access to the database through MySQL Workbench and can add data using an insert script.

    Any suggestions would be appreciated.
     
  2. ComputerMan

    ComputerMan Winhost Staff

    In the error message you got is it displaying the real MySQL user? Or is it really saying "username". Also, is the username really the MySQL user for your database?

    Side Question: Did you recently use Web Deploy on your site account to deploy your web site on our servers?
     
  3. Thankyou for responding.

    No I hid the real username in the message. It did respond with the correct username.

    I have web deployed an application but it doesn't use MySQL and when I did I hadn't activated MYSQL.

    Cheers
     
  4. ComputerMan

    ComputerMan Winhost Staff

    Well in that case I think you may have misconfigured your ACL permissions for your hosting account. Contact the support department and ask them to reset your ACL permissions. Then try again.

    If it works please read our knowledge base article on how to prevent this from happening again here or our blog post.
     
    Last edited by a moderator: Oct 14, 2015

Share This Page