MySQL
  Home arrow MySQL arrow Page 2 - Beginning MySQL Tutorial
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MYSQL

Beginning MySQL Tutorial
By: W.J. Gilmore
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 209
    1999-04-03

    Table of Contents:
  • Beginning MySQL Tutorial
  • Part 1: At First Glance
  • Part 2: Datatypes and Tables
  • Part 3: Manipulating the Database
  • Part 4: Advanced MySQL Commands

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Beginning MySQL Tutorial - Part 1: At First Glance


    (Page 2 of 5 )

    MySQL is most commonly entered through telnet. (A nice Telnet program, Easyterm, can be found at http://www.arachnoid.com) Once the telnet connection to the web server has been accomplished, a second command provides access to the MySQL server. The procedure to make these connection is as follows:

    1. Connect to telnet. This involves the insertion of the given ISP username and password.


    login: devshed Password: ******** Last login: Wed Aug 12 09:49:14 from 195.103.124.222 Copyright 1992, 1993, 1994, 1995, 1996 Berkeley Software Design, Inc. Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. BSDI BSD/OS 2.1 Kernel #12: Mon Feb 23 13:46:27 EST 1998 You have new mail. www24:mywww/devshed#

    2. Connect to MySQL. This involves the insertion of the username and password given specifically for MySQL use. This information has probably been provided to you at your request to the ISP provider.


    www24:mywww/devshed# mysql -u devshed -p

    Syntax: mysql -h hostname -u username -p[password]
    Or
    mysql -h hostname -u username --password=password

    The user will then be prompted for a password, as prompted by -p.


    Enter password: *******

    Assuming MySQL has been correctly installed and configured, the user will see output similiar to the following:


    Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 49 to server version: 3.21.23-beta-log Type 'help' for help. mysql>

    (Note: If an error message pertaining to "Access denied" is the result of connection attempts, you should consult the MySQL documentation included with the software, the MySQL mailing list found at http://www.mysql.com, as well as your ISP provider. These resources will aid greatly in resolving these problems.)

    Once connected to the database, we are free to execute the various commands of the MySQL language. However before we are able to modify the database, we must first connect to it, via the command:


    mysql> use devshed;

    Result:


    Database changed Mysql>

    You now are connected to the database. Note that the command was followed by a semi-colon (;). Almost all commands in MySQL are followed by a semi-colon.

    At the disposition are a number of administrative commands. These commands can be viewed simply by typing help, \h or ? at the command line:


    mysql> help help (\h) Display this text ? (\h) Synonym for `help' clear (\c) Clear command connect (\r) Reconnect to the server. Optional arguments are db and host edit (\e) Edit command with $EDITOR exit (\) Exit mysql. Same as quit go (\g) Send command to mysql server print (\p) print current command quit (\q) Quit mysql rehash (\#) Rebuild completion hash status (\s) Get status information from the server use (\u) Use another database. Takes database name as argument Connection id: 49 (Can be used with mysqladmin kill) mysql>

    Perhaps not all functions will not be immediately useful, however it would be wise to test each one to see exactly what it entails. However, functions such as: status, use, print, connect, clear, and quit will probably prove to be very useful from the start, so be sure to become familiar with them.

    You should now have a basic understanding of how to connect to the server, select the database, and perform basic commands. The next section will cover the concepts and techniques needed to properly setup up the database for manipulation.

    More MySQL Articles
    More By W.J. Gilmore


       · A very simple and quick introduction to MYSQL, a useful reference for any...
     

       

    MYSQL ARTICLES

    - Take Some Load off MySQL with MemCached
    - MySQL Table Prefix Changer Tool in PHP
    - Using the SIGNAL Statement for Error Handling
    - Error Handling Examples
    - Error Handling
    - Completing a Search Engine with MySQL and PH...
    - Paginating Result Sets for a Search Engine B...
    - Building a Search Engine with MySQL and PHP 5
    - Using Boolean Operators for Full Text and Bo...
    - PHP, MySQL and the PEAR Database
    - Working with PHP and MySQL
    - Getting PHP to Talk to MySQL
    - Creating an RSS Reader: the Reader
    - MySQL Security Overview
    - Creating the Admin Script for a PHP/MySQL Bl...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway