How to Import a CSV in MySQL Workbench

Поделиться
HTML-код
  • Опубликовано: 14 янв 2025
  • НаукаНаука

Комментарии • 30

  • @DatabaseStar
    @DatabaseStar  Месяц назад

    Do you want to save time while using MySQL Workbench? Get my Timesaver Guide to MySQL Workbench here: databasestar.mykajabi.com/lpkj-timesaver-mysql-wb/?

  • @marystellamungai4405
    @marystellamungai4405 8 месяцев назад +1

    Thanks alot,, you've solved my projects problem

  • @davidjhernandez3052
    @davidjhernandez3052 14 дней назад

    Yes, the video is for perfect circumstances w/perfect results, Good !!. It does't addesse when the imported .cvs yields all fields on all columns as NULLs on a newly created table. All params: Checked. Project due 01/03/25. I am stuck. Any ideas please? Thanks.

    • @DatabaseStar
      @DatabaseStar  9 дней назад

      Thanks for the feedback! As mentioned on your comment on the other video, if you're having problems importing a CSV file, there are several things I can suggest. First, try importing it into a table with all fields set as a text value. They are less restrictive than numbers, and oftne let values in that other columns don't.
      Also, check how quotes are handled, sometimes values with single quotes are not handled correctly. I'll create a video on this in the future.

  • @Jon4President
    @Jon4President Год назад

    Thanks for the tutorial!

  • @sachintamangyonjan66
    @sachintamangyonjan66 Месяц назад

    Hi, I tried importing a csv file on MySQL workbench with more than 10 columns. While importing, it doesn't allow me to check the data types of all the columns and change them before hand. Do you have any solution for that?

    • @DatabaseStar
      @DatabaseStar  Месяц назад

      Hmm that makes it tricky. I would probably try to import the CSV into a table with a text or varchar data type, as this will likely import the data as-is. Then you can convert it into the type you need.

  • @LotfyKozman
    @LotfyKozman Год назад +1

    Is there's a way to auto sync between MYSQL and the csv file?

    • @DatabaseStar
      @DatabaseStar  Год назад +2

      I'm not sure, there might be a way. Maybe a regular scheduled job could be set up to re-import the CSV every so often.

    • @dmax9324
      @dmax9324 2 месяца назад

      Did you ever find a good way to do this?

  • @victorray9369
    @victorray9369 Год назад

    yet to see any update for postgres or mysql related section in your paid course

    • @DatabaseStar
      @DatabaseStar  Год назад

      Hi Victor, I add new courses about once every two months. I've just recently re-released the Introduction to SQL course which includes Postgres and MySQL, and I'm working on updating the course that comes after that. I've got a couple of other upcoming courses that include Postgres and MySQL as well.

  • @sophialawal7306
    @sophialawal7306 Год назад +1

    Hello, thank you so much for the video, unfortunately I tried to import a csv file and i got this error "Unhandled exception: 'ascii' codec can't decode byte 0xc3 in position 24: ordinal not in range(128)
    Check the log for more details." I will appreciate if you can give more insight, I have tried all the solutions on stack overflow but nothing seems to work

    • @sophialawal7306
      @sophialawal7306 Год назад

      I am using a MAC OS

    • @DatabaseStar
      @DatabaseStar  Год назад

      Thanks! I'm guessing that error refers to a character in position 24 in your file that can't be read. I would suggest opening the file in a text editor such as Atom or VS Code to see what is in that position.

    • @sophialawal7306
      @sophialawal7306 Год назад

      @@DatabaseStar Thank you so much for your reply

  • @Sajid10109
    @Sajid10109 Год назад

    i have big csv file
    it is taking lot of time to import data
    do you have any other way to import big csv file in mysql workbench

    • @DatabaseStar
      @DatabaseStar  Год назад

      There's a command in MySQL called Load Data which you could look into using. It may perform better for importing large CSV files.

  • @ivanzq21
    @ivanzq21 Год назад

    hello, I canons, I got this message:
    Unhandled exception: 'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128)

    • @DatabaseStar
      @DatabaseStar  Год назад +1

      I'm guessing there's a character that's being imported that MySQL Workbench doesn't like. Perhaps there's a way to change the character set in the import process, or when saving the file.

  • @lautiackerman
    @lautiackerman Год назад

    Hola, tengo un archivo .CSV de 143MB. Va a tardar días en hacer el import, no? Lo dejé un rato y la barra de carga no se movió nada haha

    • @DatabaseStar
      @DatabaseStar  Год назад

      Hi, you could use the text command which may be faster. It's called LOAD DATA INFILE. I'd suggest looking up a tutorial or article on how to use that.

  • @OZTutoh
    @OZTutoh 3 месяца назад

    I was really hoping you'd show how to do it in actual SQL code

    • @DatabaseStar
      @DatabaseStar  3 месяца назад +1

      I can create another video on doing this using SQL code, or specifically the MySQL command to import a file.

  • @amanygaber330
    @amanygaber330 Год назад

    Thanks a lot