|
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,....) |