Category Archives: MySQL

Add user in mysql

The classic three-liner for adding a MySQL user, run from a mysql shell connected as root or another account with the CREATE USER privilege. Replace each placeholder with your own value. 123CREATE USER ‘YOUR_USER_NAME’@’CONNECTING_FROM_WHERE’ IDENTIFIED BY ‘THIS_USER_PASSWORD’; GRANT ALL PRIVILEGES … Continue reading

Posted in MySQL | Leave a comment

Calling a mysql query from linux or dos command line

There are times when you want to call a mysql command from the bash or dos script then call this script in a scheduler (cron job). The example below will show you how to do so. 1mysql -uYOURUSERNAME -pYOURPASSWORD -DYOURDATABASE … Continue reading

Posted in Database, Linux, MySQL | Leave a comment

MySQL Backup and Restore – Using Command Line

Here’s how you back up a database from the command line. The first line is the backup, the second is the restore. These commands work on both Windows and Linux. On Windows you might want to add the MySQL bin … Continue reading

Posted in Database, Linux, MySQL | Leave a comment