<< 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 219 Another way to set the password is by using the mysqladmin command: shell> mysqladmin -u root password new_password Only users with write/update access to the  mysql  database can change the password for others users.  All normal users (not anonymous ones) can only change their own password with either of the above commands or with SET PASSWORD=PASSWORD('new password'). Note  that  if  you  update  the  password  in  the  user  table  directly  using  the   rst  method, you must tell the server to re-read the grant tables (with FLUSH PRIVILEGES), because the change will go unnoticed otherwise. Once the root password has been set, thereafter you must supply that password when you connect to the server as root. You may wish to leave the root password blank so that you don't need to specify it while you perform additional setup or testing.  However, be sure to set it before using your installation for any real production work. See the scripts/mysql_install_db script to see how it sets up the default privileges.  You can use this as a basis to see how to add other users. If you want the initial privileges to be di erent from those just described above, you can modify mysql_install_db before you run it. To re-create the grant tables completely, remove all the `.frm', `.MYI', and `.MYD' les in the directory containing the mysql database.  (This is the directory named `mysql' under the database directory, which is listed when you run mysqld --help.)  Then run the mysql_ install_db script, possibly after editing it rst to have the privileges you want. Note:  for  MySQL  versions  older  than  Version  3.22.10,  you  should  not  delete  the  `.frm' les.  If you accidentally do this, you should copy them back from your MySQL distribution before running mysql_install_db. 4.3.5  Adding New Users to MySQL You can add users two di erent ways:  by using GRANT statements or by manipulating the MySQL grant tables directly.  The preferred method is to use GRANT statements, because they are more concise and less error-prone.  See Section 4.3.1 [GRANT], page 212. There are also a lot of contributed programs like phpmyadmin that can be used to create and administrate users.  See Section 1.6.1 [Portals], page 22. The following examples show how to use the mysql client to set up new users.  These exam- ples assume that privileges are set up according to the defaults described in the previous section.  This means that to make changes, you must be on the same machine where mysqld is running, you must connect as the MySQL root user, and the root user must have the INSERT  privilege for the  mysql  database and the  RELOAD  administrative privilege.  Also, if you have changed the  root  user password,  you must specify it for the  mysql  commands here. You can add new users by issuing GRANT statements: shell> mysql --user=root mysql mysql> GRANT ALL PRIVILEGES ON *.* TO monty@localhost -> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
     

    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