skip to Main Content

I have a script that collects information and generates a CSV file with it.

I don’t have remote access to MySQL via port 3306 released, I just have access to phpmyadmin through the browser using login and password.

The codes I’ve found apparently only work by directly accessing the database via 3306.

Would it be possible to convert the CSV file to MySQL embed code and open the browser, login and run the embed code via Python? (Chromedriver?)

2

Answers


  1. In PHPMyadmin you can choose CSV format on "Import" tab.

    enter image description here

    Login or Signup to reply.
  2. Yoy can use SQL command too… like below.
    But in this case your Client need to have access to CSV file.

    LOAD DATA LOCAL INFILE 'C:/<PATH TO YOUR FILE>/YOURS-CSV-FILE.csv' 
    INTO TABLE `tabe_name` 
    FIELDS TERMINATED BY ',' 
    ENCLOSED BY '"'
    LINES TERMINATED BY 'n'
    IGNORE 1 ROWS (`column1Name`,`column2Name`,`column3Name`,`column4Name`);
    

    More in documentation: https://dev.mysql.com/doc/refman/8.0/en/load-data.html

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search