05 January,2011 by Tom Collins
Prerequisites
1)Putty client
2)Username\Password of a valid Linux user
3)Username,hostname,password of MySQL server
4)Database name – assume it’s called MYDB
Steps
Logon to Linux server using Putty with information from step 2) of Prerequisites
From the command line type:
mysql -uUSERNANE -hHOST –pPASSWORD
replacing USERNAME,HOST and PASSWORD with valid details from step 3) of Prerequisites
If successful you’ll see a message such as : Welcome to the MySQL Monitor and the mysql prompt:
mysql>
To use a database do, which will change the context :
mysql>use MYDB;
To list all tables:
mysql>show tables;
+-------------------+
| Tables_in_MYDB |
+-------------------+
| archive |
| category |
| categorylinks |
| change_tag |
| external_user |
| externallinks |
| filearchive |
| hitcounter |
+-------------------+
To select some records from a table :
mysql>SELECT * FROM archive;
This is a basic introduction – check out the mysql reference for more DML options
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |