I have been trying to import the US.txt file into mySQL using the code on import. I am able to log into PHPMyAdmin just fine, but when I run ./import US.txt, I get the following error:

$ ./import US.txt PHP Fatal error: could not find driver in /home/ubuntu/workspace/pset8/vendor/library50-php-5/CS50/CS50.php on line 313

Fatal error: could not find driver in /home/ubuntu/workspace/pset8/vendor/library50-php-5/CS50/CS50.php on line 313

I have tried all the advice from after searching all over CS50 Stack Exchange. I have been stuck on this same issue for a week now. I must say as much as I LOVE the CS50 course, the IDE bugs for pset7/8 have wasted a lot of time when the opportunity cost of studying CS50 content is already so high!

Any ideas of how I could solve this?

  • Assuming you finished pset7, does it still work? What version of the IDE? (version50)? Don't look at the "IDE bugs" as wasted time. It is experience in what developers/programmers face every day! Also note that the pset8 exercise has changed in the 2017 CS50x, it now uses sqlite3 instead of mysql. Jan 4, 2017 at 11:25
  • Thanks for the tip @DinoCoderSaurus. I am using version 94. I don't really have the luxury of time so I ended up uploading the data manually using import on mySQL. Out of curiosity, what would have been the best way to get around this assuming that I did not have any permission issues (I was able to access the map and mySQL)? Jan 4, 2017 at 15:28
  • You got around it beautifully (so the best way)! Assuming cgi php is working (eg pset7), could be a problem with command line php. (And since this is the only time it's used, good idea to move on). Another option might have been to write import as a "web page" and run it in a browser. Jan 4, 2017 at 19:17
  • Super thanks so much.! Jan 5, 2017 at 13:59


You must log in to answer this question.

Browse other questions tagged .