The gift of the command line

Happens a lot. You wanna perform a task and see the GUI admin interface thinking maybe it’s time to trust it with your task. I simply try to import an SQL dump file through phpMyAdmin and it goes “You probably tried to upload too large file. Please refer to documentation for ways to workaround this limit.“. OK, so maybe the SQL file is a bit large, 40 MB+ in size. I compress it and try again. loading for some time and then a blank white screen. 4 partially successful imports out of 30+! Maybe I compressed a very large file so let’s try increasing maximum file size and put plain SQL file.

Go to php.ini and alter upload_max_filesize, memory_limit and post_max_size accordingly. Restart server (note: localhost, I didn’t shutdown production server dont worry!), try again, same thing. I give it over an hour just to be sure it’s not me prejudging.

Ohh what the heck am I doing! Open up the terminal,

mysql <my_db_name> -u<user_name> -p<password> <mysql.sql

Done in few seconds!

Popularity: 1% [?]

Related Posts:

Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.

Comments

Ever heard of Travian?
Their servers used to get heavy loads so I wrote a shell script to get all servers, ping them, sort them and give the one with the lowest latency.

Simple & beautiful.

<3 CLI

MBH,
Share the script! Share the knowledge ;)

MBH: That’s smart :). Games is so popular I feel ignorant not knowing it.

Bashar, The game starts to be interesting but it takes about 9 months before the actions starts and in Arab servers you only get morons and LOTS of DUMB politics.

IF you are to play, play on US servers.

nbq, It’s all here.

Oh, I forgot to say that I quit the game long ago. I think I played for 4 months!!!

MBH: I only tried WOW for a week and uninstalled it. I have a life and this is so addictive.

Good you quit the game I say :)

never punch commands lines when too excited or in a hurry!

Though it’s faster than web interface, if applicable, I’d rather use the latter in certain situations!

maryam: Hmm… why so? I admit you could fire a command line like the one we had in a banking system. Story was for some reason a guy punched in “PURGE *.*”. That would delete everything on the system. Let me say that again, it deleted everything on the PRODUCTION SYSTEM.

They did work on all backup but there was one core file which was non-recoverable. He said the poor guy ended up selling cigarettes on the corner for the street :P.

Leave a comment