Neuigkeiten
  • Die modified eCommerce Shopsoftware ist kostenlos, aber nicht umsonst.
    Spenden
  • Damit wir die modified eCommerce Shopsoftware auch zukünftig kostenlos anbieten können:
    Spenden
  • Thema: 1045 Access denied for user 'my-user'@'localhost' (using password: YES)

    papalife

    • Mitglied
    • Beiträge: 174
    Hello Team,

    I have a php file(includes mysql commands) in the root folder of modified and I want to run it directly on my browser but I get this error. How can I solve it ?

    Thanks,
    Apo

    Linkback: https://www.modified-shop.org/forum/index.php?topic=30785.0

    Matt

    • Experte
    • Beiträge: 4.241
    Use correct credentials.

    Or include includes/application_top.php and use the functions provided by modified.

    papalife

    • Mitglied
    • Beiträge: 174
    I include includes/application_top.php but I get the error. I have a select query in this php file with which i collect data from the database and i want to save them in a folder in my webspace and after save them to send them by mail.

    papalife

    • Mitglied
    • Beiträge: 174
    I have seen that I have problem with this command at the end of SELECT sql-command

    INTO OUTFILE '" .  dirname(__FILE__) . "/folder1/data.csv'
    FIELDS TERMINATED BY ';'
    LINES TERMINATED BY '\n'");

    Maybe I cant create and save a csv file in a folder of my webspace. Any idea if this is provider problem or there is solution ?

    Thanks Apo

    Modulfux

    • Experte
    • Beiträge: 3.590
    • Geschlecht:
    If you haven't any rights or permission to write into this folder you won't solve it. The problem is that the sql-user tries to write into a folder like /var/tmp/ due to the default settings in the mysql.ini.

    If you are on a shared webhosting you can't solve it. For those methods you need more rights to change the default setting of the sql-server.

    noRiddle (revilonetz)

    • Experte
    • Beiträge: 13.990
    • Geschlecht:
    Try chdir() before including the application_top.php:
    Code: PHP  [Auswählen]
    chdir('/WHOLE_ABSOLUTE_PATH/');

    Regards,
    noRiddle

    Matt

    • Experte
    • Beiträge: 4.241
    A lot of providers don't grant FILE to the MySQL users due to security issues. You should check with your provider if that's the case with your setup.

    If you have the FILE privilege: MySQL can't override files. If the file exists you will get the exact same Access denied error.
    If you don't have it: Use php to write the file (fputcsv comes in handy here).

    papalife

    • Mitglied
    • Beiträge: 174
    A solution can be that the file will be already exists and when I want I will write in it data using FPUTCSV. I have sent an email to my provider and I am expecting his answer.

    Thanks