SingleStore DB

change-root-password

Change the MemSQL root password for a MemSQL node on the local machine.

Usage

You can retrieve help for the command by typing <application> [command] --help in the command line.

Remarks

When running this command, memsqlctl will attempt to connect to a running node using the root user and existing root password for the node that is already stored in nodes.hcl. If the existing root password doesn’t work, then the nodes.hcl file has become out of sync with the current state of the node. This can be caused by either a manual password change by the user without using memsqlctl, or the root password was encrypted with an older encryption key. To fix this issue, memsqlctl will try to connect to the node with new password, and if it works, memsqlctl will update nodes.hcl with the new password encrypted with the current encryption key. This behavior allows change-root-password to be used to update memsqlctl when there is state drift.

The new password can also be specified through the environment variable MEMSQL_PASSWORD instead of as a command-line argument.

Once connected, memsqlctl will run GRANT… SQL commands on the node to change the password to the new password and then update nodes.hcl.

Important

The change-root-password command can only be run on nodes in a running process state.

This command is interactive unless you use either --yes or --json flag to override interactive behavior.

The memsqlctl change-root-password command is equivalent to the sdb-admin change-root-password command.

Output

The following is the standard output for the change-root-password command.

$ sudo memsqlctl change-root-password --password "NewSecurePass"
+-------+------------+------------+------+---------------+---------+
| Index | MemSQL ID  |    Role    | Port | Process State | Version |
+-------+------------+------------+------+---------------+---------+
| 1     | 01FA0ABD58 | Aggregator | 3306 | Running       | 6.5.10  |
| 2     | 994274A024 | Leaf       | 3307 | Running       | 6.5.10  |
| 3     | All Nodes  |            |      |               |         |
+-------+------------+------------+------+---------------+---------+
Select an option: 2
memsqlctl will perform the following actions
  · On SingleStore node with ID 994274A024996ADAD6B1B780352C0EDBC0E7328F:
    - Run `SET PASSWORD FOR 'root'@'%' = PASSWORD(***)`

Would you like to continue? [y/N]: y
✓ Set new password for node with MemSQL ID 994274A024996ADAD6B1B780352C0EDBC0E7328F