# How to alter the user password

**URL:** <https://www.singlestore.com/forum/t/how-to-alter-the-user-password/1845>\
**Category:** Security\
**Created:** [April 20, 2020, 3:31am UTC](https://www.singlestore.com/forum/t/how-to-alter-the-user-password/1845 "2020-04-20T03:31:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rjsv](https://www.singlestore.com/forum/letter_avatar_proxy/v4/letter/r/f17d59/32.png) [@rjsv](https://www.singlestore.com/forum/u/rjsv)\
**Post date:** [April 20, 2020, 3:31am UTC](https://www.singlestore.com/forum/t/how-to-alter-the-user-password/1845/1 "2020-04-20T03:31:23Z")

</div>

I have created a user as below.

CREATE USER ‘admin1’@’%’ IDENTIFIED BY ‘raojsv!123’;

When I tried to change the password using below command,I am facing the issue. Please guide me how to proceed.

ALTER USER admin1 IDENTIFIED BY ‘Ecmbu!23root’;

## Error details:-

SQL Error [1064] [42000]: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 2

---

<div class="post-metadata">

**Author:** ![hanson](https://www.singlestore.com/forum/user_avatar/www.singlestore.com/hanson/32/196_2.png) [@hanson](https://www.singlestore.com/forum/u/hanson)\
**Post date:** [April 20, 2020, 5:45pm UTC](https://www.singlestore.com/forum/t/how-to-alter-the-user-password/1845/2 "2020-04-20T17:45:23Z")

</div>

Looks like “!23root” is getting interpreted by the Linux command shell.

Use a password without an exclamation point.

---

<div class="post-metadata">

**Author:** ![danderson](https://www.singlestore.com/forum/letter_avatar_proxy/v4/letter/d/f19dbf/32.png) [@danderson](https://www.singlestore.com/forum/u/danderson)\
**Post date:** [April 23, 2020, 4:39pm UTC](https://www.singlestore.com/forum/t/how-to-alter-the-user-password/1845/3 "2020-04-23T16:39:36Z")

</div>

Actually it will work if you use SET PASSWORD. ALTER USER is the wrong command to use to change a password. I have opened a task to clarify this in the docs, but here is the doc you need:  
[https://docs.memsql.com/v7.0/reference/sql-reference/security-management-commands/set-password/](https://docs.memsql.com/v7.0/reference/sql-reference/security-management-commands/set-password/)

> SET PASSWORD FOR ‘admin1’ = PASSWORD(‘Ecmbu!23root’)

Should work for you

---

<div class="post-metadata">

**Author:** ![minkyung.kang](https://www.singlestore.com/forum/letter_avatar_proxy/v4/letter/m/e99b99/32.png) [@minkyung.kang](https://www.singlestore.com/forum/u/minkyung.kang)\
**Post date:** [March 28, 2023, 7:26am UTC](https://www.singlestore.com/forum/t/how-to-alter-the-user-password/1845/4 "2023-03-28T07:26:54Z")

</div>

Hi all.

While attempting to change the password of root using ALTER USER, I found the following result:

```auto
-- An error occurred.
singlestore> ALTER USER root IDENTIFIED BY 'abcd';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

-- The query ran successfully, but the password was not modified.
singlestore> ALTER USER root IDENTIFIED BY 'abcd' ACCOUNT UNLOCK;
Query OK, 0 rows affected (0.00 sec)

-- The query ran successfully, and the password was modified. 
singlestore> ALTER USER root IDENTIFIED BY 'abcd' SET DEFAULT RESOURCE POOL = test_pool;
Query OK, 0 rows affected (0.00 sec)
singlestore> ALTER USER root IDENTIFIED BY 'efgh' REQUIRE NONE;
Query OK, 0 rows affected (0.00 sec)

```

It appears that changing the password works when using certain options.  
Is it unexpected result, or is it normal?

If I can’t change the password with the `ALTER USER` command,  
when should I use the IDENTIFIED BY option?
