ERROR: Can't initialize batch_readline - may be the input source is a directory or a block device

Evanss picture Evanss · Feb 11, 2015 · Viewed 17.9k times · Source

I have Mamp Pro. Im trying to import a databse via the command line as its too large for PHPMyAdmin using these instructions: http://nickhardeman.com/308/export-import-large-database-using-mamp-with-terminal/

When I enter the following im prompted for my password:

/applications/MAMP/library/bin/mysql -u root -p DBNAME.sql < /Applications/MAMP/htdocs/FOLDERNAME 

However when I enter it I get this message:

ERROR: Can't initialize batch_readline - may be the input source is a directory or a block device.

Answer

Gilberto Trevi&#241;o picture Gilberto Treviño · Mar 24, 2015

I think you have something wrong with that command, it should be:

/applications/MAMP/library/bin/mysql -u root -p DBNAME < /Applications/MAMP/htdocs/FOLDERNAME/BACKUP_FILENAME.sql