ARCHIVED: At IU, how do I change my MySQL password on the RDC?

This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.
Note:
On Indiana University's Research Database Complex (RDC), to help prevent accidental data loss, the variable SQL_SAFE_UPDATES is set by default to 1. To change your MySQL password on the RDC, you must temporarily change this variable to 0, and then reset it to 1 when you're finished.

To change your MySQL password on the RDC:

  1. At the RDC command prompt, enter:
      mysql --defaults-file=~/.my.cnf -u root -p
  2. Enter your password when prompted.
  3. Change the SQL_SAFE_UPDATES value; at the mysql prompt, enter:
      SET SQL_SAFE_UPDATES=0;
  4. Reset your MySQL password; enter (replace newpw with your new password):
      UPDATE mysql.user SET password = PASSWORD('newpw') where user='root';
  5. Reload the privileges from the database grant tables; enter:
      FLUSH PRIVILEGES;

    Note: The message that appears may indicate there was one warning; this is okay.

  6. Reset SQL_SAFE_UPDATES to its original value; enter:
      SET SQL_SAFE_UPDATES=1;

If you need help or have questions, email the UITS High Performance Systems group.

This is document axry in the Knowledge Base.
Last modified on 2018-02-21 14:06:11.