<< previous page   --   table of contents   --   next page >>
| | | | | | | |
  • Return to Table of Contents
  • Table of Contents

    1. General Information
    2. MySQL Installation
    3. Tutorial Introduction
    4. Database Administration
    5. MySQL Optimisation
    6. MySQL Language Reference
    7. MySQL Table Types
    8. MySQL APIs
    9. Extending MySQL

    Chapter 4:  Database Administration 223 Also, current values for all users will be ushed if privileges are reloaded (in the server or using mysqladmin reload) or if the FLUSH USER_RESOURCES command is issued. The feature is enabled as soon as a single user is granted with any of the limiting  GRANT clauses. As  a  prerequisite  for  enabling  this  feature,  the  user  table  in  the  mysql  database  must contain the additional columns, as de ned in the table creation scripts mysql_install_db and mysql_install_db.sh in `scripts' subdirectory. 4.3.7  Setting Up Passwords In most cases you should use GRANT to set up your users/passwords, so the following only applies for advanced users.  See Section 4.3.1 [GRANT], page 212. The examples in the preceding sections illustrate an important principle:  when you store a non-empty password using INSERT or UPDATE statements, you must use the PASSWORD() function to encrypt it.  This is because the user table stores passwords in encrypted form, not as plaintext.  If you forget that fact, you are likely to attempt to set passwords like this: shell> mysql -u root mysql mysql> INSERT INTO user (Host,User,Password) -> VALUES('%','jeffrey','biscuit'); mysql> FLUSH PRIVILEGES; The  result  is  that  the  plaintext  value  'biscuit'  is  stored  as  the  password  in  the  user table.  When the user jeffrey attempts to connect to the server using this password, the mysql  client encrypts it with  PASSWORD(),  generates an authenti cation vector based on encrypted password and a random number, obtained from server, and sends the result to the server.  The server uses the  password  value in the  user  table (that is  not encrypted value 'biscuit') to perform the same calculations, and compares results.  The comparison fails and the server rejects the connection: shell> mysql -u jeffrey -pbiscuit test Access denied Passwords  must  be  encrypted  when  they  are  inserted  in  the  user  table,  so  the  INSERT statement should have been speci ed like this instead: mysql> INSERT INTO user (Host,User,Password) -> VALUES('%','jeffrey',PASSWORD('biscuit')); You must also use the PASSWORD() function when you use SET PASSWORD statements: mysql> SET PASSWORD FOR jeffrey@"%" = PASSWORD('biscuit'); If  you  set  passwords  using  the  GRANT ... IDENTIFIED BY  statement  or  the  mysqladmin password  command,  the  PASSWORD()  function  is  unnecessary.    They  both  take  care  of encrypting the password for you, so you would specify a password of 'biscuit' like this: mysql> GRANT USAGE ON *.* TO jeffrey@"%" IDENTIFIED BY 'biscuit'; or shell> mysqladmin -u jeffrey password biscuit Note:  PASSWORD() does not perform password encryption in the same way that Unix pass- words are encrypted.  You should not assume that if your Unix password and your MySQL
     

    Customer Support CentreMySQL Reference Manual

    Web Hosting Services
    UNIX WEB HOSTING
    SUPPORT & FAQ's
    TERMS OF USE
    Domain Services
    DOMAIN REGISTRATION
    MANAGE YOUR ACCOUNT
    SUPPORT & FAQ's
    TERMS OF USE
    SITE MAP
    Home
    Hosting Plans | Domain Registration | About Us | Contact Us | Site Map
    Terms of Use | Privacy Policy | Guarantees
    Merchant Accounts

    SpiritHost - web hosting for spiritual and education sites
    SpiritHit.com - Religious and Spiritual Portal
  • Return to Table of Contents
  • Back to top

  • Web Hosting: Manuals & FAQ's

    1. Unix-Based Web Hosting
    2. Unix Dedicated Servers
    3. Windows Dedicated Servers
    4. CuteFTP User’s Guide
    5. CuteHTML User’s Guide
    6. WS_FTP Pro User's Guide
    7. Miva Order User's Guide
    8. Miva Merchant User's Guide