Home arrow MySQL arrow Page 2 - Beginning MySQL Tutorial

Part 1: At First Glance - MySQL

One of the fastest SQL (Structured Query Language) database servers currently on the market is the MySQL server, developed by T.c.X. DataKonsultAB. MySQL, available for download at http://www.mysql.com, offers the data base programmer with an array of options and capabilities rarely seen in other database servers. What's more, MySQL is free of charge for those wishing to use it for private and commercial use.

  1. Beginning MySQL Tutorial
  2. Part 1: At First Glance
  3. Part 2: Datatypes and Tables
  4. Part 3: Manipulating the Database
  5. Part 4: Advanced MySQL Commands
By: W.J. Gilmore
Rating: starstarstarstarstar / 293
April 03, 1999

print this article



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 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]
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;


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

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Oracle Unveils MySQL 5.6
- MySQL Vulnerabilities Threaten Databases
- MySQL Cloud Options Expand with Google Cloud...
- MySQL 5.6 Prepped to Handle Demanding Web Use
- ScaleBase Service Virtualizes MySQL Databases
- Oracle Unveils MySQL Conversion Tools
- Akiban Opens Database Software for MySQL Use...
- Oracle Fixes MySQL Bug
- MySQL Databases Vulnerable to Password Hack
- MySQL: Overview of the ALTER TABLE Statement
- MySQL: How to Use the GRANT Statement
- MySQL: Creating, Listing, and Removing Datab...
- MySQL: Create, Show, and Describe Database T...
- MySQL Data and Table Types
- McAfee Releases Audit Plugin for MySQL Users

Developer Shed Affiliates


Dev Shed Tutorial Topics: