Update Ubuntu server

Ubuntu server doesn’t have GUI, unless you installed it. So here’s how you update the server using the command line

$ sudo apt-get update

This refreshes the update list and the following actually pulls to cache and installs it. It certainly is a long process – so choose a weekend time to be doing this.

$ sudo apt-get dist-upgrade

Just to be on the safer side, do a restart once everything gets alright.

Import MySQL – the command line way

Here’s a neat way to import sql script into MySQL database via command line.

mysql -u [database_user_name] -p -h localhost [database_name] 
< [/path/to/sql/file] > null

This will prompt you for the password and you’re done in a jiffy.