MySQL
  Home arrow MySQL arrow Page 3 - Working with the MySQL Access Privileg...
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 
Actuate Whitepapers 
VeriSign Whitepapers 
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

Working with the MySQL Access Privilege System
By: Sams Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2006-06-08

    Table of Contents:
  • Working with the MySQL Access Privilege System
  • 4.4.3 Privileges Provided by MySQL
  • 4.4.4 Connecting to the MySQL Server
  • 4.4.5 Access Control, Stage 1: Connection Verification
  • 4.4.6 Access Control, Stage 2: Request Verification
  • 4.4.7 When Privilege Changes Take Effect
  • 4.4.9 Password Hashing in MySQL 4.1

  • 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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Working with the MySQL Access Privilege System - 4.4.4 Connecting to the MySQL Server


    (Page 3 of 7 )

    MySQL client programs generally expect you to specify connection parameters when you want to access a MySQL server:

    • The name of the host where the MySQL server is running

    • Your username

    • Your password

    For example, the mysql client can be started as follows from a command-line prompt (indicated here by shell>):

    shell> mysql -h host_name -u user_name -pyour_pass

    Alternate forms of the -h, -u, and -p options are --host=host_name, --user=user_name, and --password=your_pass. Note that there is no space between -p or --password= and the password following it.

    If you use a -p or --password option but do not specify the password value, the client program will prompt you to enter the password. The password is not displayed as you enter it. This is more secure than giving the password on the command line. Any user on your system may be able to see a password specified on the command line by executing a command such as ps auxww. See Section 4.5.6, "Keeping Your Password Secure."

    MySQL client programs use default values for any connection parameter option that you do not specify:

    • The default hostname is localhost.

    • The default username is ODBC on Windows and your Unix login name on Unix.

    • No password is supplied if -p is missing.

    Thus, for a Unix user with a login name of joe, all of the following commands are equivalent:

    shell> mysql -h localhost -u joe
    shell> mysql -h localhost
    shell> mysql -u joe
    shell> mysql

    Other MySQL clients behave similarly.

    You can specify different default values to be used when you make a connection so that you need not enter them on the command line each time you invoke a client program. This can be done in a couple of ways:

    • You can specify connection parameters in the [client] section of an option file. The relevant section of the file might look like this:

      [client]
      host=host_name
      user=user_name
      password=your_pass
    • Option files are discussed further in Section 3.3.2, "Using Option Files."

    • You can specify some connection parameters using environment variables. The host can be specified for mysql using MYSQL_HOST. The MySQL username can be specified using USER (this is for Windows and NetWare only). The password can be specified using MYSQL_PWD, although this is insecure; see Section 4.5.6, "Keeping Your Password Secure." For a list of variables, see Appendix B, "Environment Variables."

    More MySQL Articles
    More By Sams Publishing


       · This article is an excerpt from the book "MySQL Administrator's Guide," published by...
       · The tables do not work if you convert to PDF. It's a pity because it looks like a...
     

    Buy this book now. This article is excerpted from the book MySQL Administrator's Guide, written by Paul Dubois (Sams; ISBN: 0672326345). Check it out today at your favorite bookstore. Buy this book now.

       

    MYSQL ARTICLES

    - 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...
    - Creating the Blog Script for a PHP/MySQL Blo...





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