Thursday 17, May 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    About Us    |    Contact Us

Mysql Command Line

MySQL is a very powerful open source database which means that it is free to use. One of the many tools that come with MySQL is their MySQL Command Line that will allow you to do pretty much everything from create a database to add and edit entries in the database. This article will help you to begin using MySQL Command Line Successfully.


When you install MySQL you will receive a command line application where you can create new databases, modify current databases, and delete databases.



Once you launch the MySQL Command Line Client you will be prompted for a password assuming you set one up when you installed MySQL. From here you will be given a mysql> prompt and you will be able to enters your commands.

Lets start with creating a database in our system:


mysql> CREATE DATABASE temp;
Query OK, 1 row affected (0.00 sec)


Be sure that when creating databases, tables, and fields that the names are case sensitive and cannot include spaces.
All commands issued through the command line must end with a semi-colon (;) or else you will be promtped for more commands.


In order to edit this new database we have created we need to switch to it and that is where the USE command comes into play.


mysql> USE temp;
Database changed


Now that we have a working database lets create a table in the database to store our relatives


mysql>CREATE TABLE family (name char(25), age integer, relation char(50));
Query OK, 0 rows affected (0.05 sec)


We just created a table that contains three fields so lets go into a little more detail about that command we just ran.

First we used the CREATE TABLE command which does exactly what it says does and it creates the table. Where we typed in family
is the name of the table that we just created. Everything else within the parenthasis are fields in the table and what type of information is going to be stored in that field. For example that name char(25) tells SQL to create a field within the table called "name" and the char(25) tells it that it will be a character field meaning you can type any character you want in it and that it is 25 characters long. The age integer tells SQL to create a field in the table called age and that it will be a integer meaning that only whole numbers are stored in this field. You can add a size to the integer field like when using char but it is not nessecary as the default length of an interger field is 11. The last one is just like the first one realtion char(50) except for the fact that we made this field able to hold 50 characters instead of 25.

Now that we have created a database and a table lets look at a coupld show commands to see what we have. The show commands are pretty straight forward in terms of what they do. Lets start with SHOW DATABASES;

 
     ARTICLE REVIEWS
thanks for helpful article
Poested By : habib Posted On : 03/25/2010
 
     POST REVIEW
Full Name :
E-mail :  (will not publish)
Web Site :  (optional)
Review :
 
Security Code :
 
 
     RELATED ARTICLES
Data Management: Efficient Controlling of Your Data
Unquestionably, the most valuable assets of any company would be its data. Imagine if our computers stop working for one day, what would happen to our daily chores and pre-defined plans? We would certainly go back to stone ages – because these days...more »
   
Database-Assisted Marketing Management
Database-assisted marketing management involves choosing target markets that not only get new customers but also retain the existing ones. It is a business subject, which is based on research and study of practical applications of marketing technique...more »
   
Characteristics and Advantages of OODBMS
Use of Object Oriented Database Management System is prevalent in custom software development and for good reasons. An Object Oriented Database Management System, commonly referred to as OODBMS, is the result of integrating database management princi...more »
   
Database Sensors and Business Applications
The idea of using sensors in a database is attractive.  Several groups are working on ways to implement the sensor network approach in such a way that data can be retrieved with more flexibility.The existing networks are being used primarily for sci...more »
   
Easy Ways to Back Up Your Computer Files
In a perfect world you'd never have to worry about losing any of the important files on your computer. But in reality the chances of you losing everything on your computer are pretty high. Most people have pictures, tax files, resumes and a host of o...more »
   
 
Article Categories
 
  Affiliate Programs Articles
Affiliate Programs Articles
  Audio Articles
Audio  Articles
  Blogging Articles
Blogging  Articles
  Computer Forensics Articles
Computer Forensics Articles
  Computer Games Articles
Computer Games Articles
  Data Recovery Articles
Data Recovery Articles
  Databases Articles
Databases Articles
  Domain Names Articles
Domain Names  Articles
  E Learning Articles
E Learning Articles
  ECommerce Articles
ECommerce  Articles
  Email Articles
Email  Articles
  File Types Articles
File Types Articles
  Forex Trading Articles
Forex Trading Articles
  Forums Articles
Forums  Articles
  Hardware Articles
Hardware Articles
  Information Technology Articles
Information Technology Articles
  Internet Marketing Articles
Internet Marketing  Articles
  Intra net Articles
Intra net Articles
  Laptops Articles
Laptops Articles
  Link Popularity Articles
Link Popularity  Articles
  Networks Articles
Networks Articles
  Newsletters Articles
Newsletters  Articles
  Operating Systems Articles
Operating Systems Articles
  Programming Articles
Programming Articles
  RSS Articles
RSS  Articles
  Security Articles
Security Articles
  SEM Articles
SEM  Articles
  SEO Articles
SEO Articles
  SMO Articles
SMO  Articles
  Software Articles
Software Articles
  Spam Articles
Spam  Articles
  Videos Articles
Videos  Articles
  Web Design Articles
Web Design  Articles
  Web Hosting Articles
Web Hosting  Articles
 
 
 
POPULAR E-BOOKS
 
Download Guide To Cashing In On Ebay  Ebook Guide To Cashing In On Ebay
   
Download An Introduction to the Theory of Computation  Ebook An Introduction to the Theory of Computation
   
Download Beginners Guide to Internet Business  Ebook Beginners Guide to Internet Business
   
Download Building Texts Faster Ebook Building Texts Faster
   
Download Philip and Alex's Guide to Web Publishing  Ebook Philip and Alex's Guide to Web Publishing
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz