DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(mysql.info.gz) SET PASSWORD

Info Catalog (mysql.info.gz) RENAME USER (mysql.info.gz) Account management SQL
 
 13.5.1.5 `SET PASSWORD' Syntax
 ..............................
 
      SET PASSWORD = PASSWORD('SOME PASSWORD')
      SET PASSWORD FOR USER = PASSWORD('SOME PASSWORD')
 
 The `SET PASSWORD' statement assigns a password to an existing MySQL
 user account.
 
 The first syntax sets the password for the current user. Any client
 that has connected to the server using a non-anonymous account can
 change the password for that account.
 
 The second syntax sets the password for a specific account on the
 current server host. Only clients with the `UPDATE' privilege for the
 `mysql' database can do this.  The USER value should be given in
 `USER_NAME@HOST_NAME' format, where USER_NAME and HOST_NAME are exactly
 as they are listed in the `User' and `Host' columns of the `mysql.user'
 table entry.  For example, if you had an entry with `User' and `Host'
 column values of `'bob'' and `'%.loc.gov'', you would write the
 statement like this:
 
      mysql> SET PASSWORD FOR 'bob'@'%.loc.gov' = PASSWORD('NEWPASS');
 
 That is equivalent to the following statements:
 
      mysql> UPDATE mysql.user SET Password=PASSWORD('NEWPASS')
          -> WHERE User='bob' AND Host='%.loc.gov';
      mysql> FLUSH PRIVILEGES;
 
 * If you are connecting to a MySQL 4.1 or later server using a
 pre-4.1 client program, do not use the preceding `SET PASSWORD' or
 `UPDATE' statement without reading  Password hashing first. The
 password format changed in MySQL 4.1, and under certain circumstances
 it is possible that if you change your password, you might not be able
 to connect to the server afterward.
 
 Starting from MySQL 4.1, you can check what your current authentication
 `user@host' entry is by executing `SELECT CURRENT_USER()'.
 
Info Catalog (mysql.info.gz) RENAME USER (mysql.info.gz) Account management SQL
automatically generated byinfo2html