IE
Home arrow Blog arrow Linux arrow MYSQL Commands
MYSQL Commands Print Email
Written by Nick Yeoman   
Sunday, 25 March 2007

I have collected the most common MySQL commands I use on a daily basis. Most people connect to databases using GUI's such as phpmyadmin or MySQL query browser. I felt it's really important to know the text commands to connect to a database as it will save you hours of time by automating your tasks using shell scripts.

Change/Create Root Password

To change the MySQL root password to PaSsWoRd:

mysqladmin -u root password PaSsWoRd

Backing up and Restoring a MySQL Database

Backing up a mysql database

mysqldump -u [uname] -p [pass] [dbname] > [backupfile.sql]

Restoring your MySQL database

mysql - u [uname] -p [pass] [dbname] < [backfile.sql]

Insert A Record

INSERT INTO Tablename(col1,col2,....) Values (Value1,value2,....)

Last Updated ( 2007-07-27 19:15:17 )