Command Line Tools

mysqldump to Restore and Backup MySQL database

When you need to handle MySQL databases, it is useful to have a tool which lets you create backup files and also restore them properly; this can be achieved by using mysql and mysqldump commands in the command line. To be able to use them, you have to make sure the user you will use has the privileges to manage the database you are working with, we will be using root MySQL user to go through the examples.

Continue reading

Create new MySQL User granting permissions to new database

There are multiple systems where you need to set up a new database, Installing MySQL is always an option to achieve that, but after installation, you will have to follow some more steps to be able to provide the connection credentials to the system you are trying to connect, let’s try it following the next steps: How to create a database? First check if you have MySQL installed, you can do it running the command:

Continue reading

Compress and Extract files using SSH

Sometimes we need handy lines to be able to compress or extract files in the command line using different extensions, here are some useful lines to achieve it: Compress Files Depending on the file extension and compression technology you have to use a different command line tool. The most commonly used however is the tar.gz format. An example of creating a file with this extension is: tar -zcf filename.tar.gz foldername/ You can also create zip files using:

Continue reading