> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/old_password.md).

# OLD\_PASSWORD

## Syntax

```bnf
OLD_PASSWORD(str)
```

## Description

`OLD_PASSWORD()` was added to MySQL when the implementation of [PASSWORD()](/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/password.md) was changed to improve security. `OLD_PASSWORD()` returns the value of the old (pre-MySQL 4.1) implementation of `PASSWORD()` as a string, and is intended to permit you to reset passwords for any pre-4.1 clients that need to connect to a more recent MySQL server version, or any version of MariaDB, without locking them out.

The return value is a nonbinary string in the connection [character set and collation](/docs/server/reference/data-types/string-data-types/character-sets.md), determined by the values of the [character\_set\_connection](/docs/server/server-management/variables-and-modes/server-system-variables.md#character_set_connection) and [collation\_connection](/docs/server/server-management/variables-and-modes/server-system-variables.md#collation_connection) system variables.

The return value is 16 bytes in length, or `NULL` if the argument was `NULL`.

## See Also

* [PASSWORD()](/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/password.md)
* [MySQL manual on password hashing](https://dev.mysql.com/doc/refman/5.1/en/password-hashing.html)

<sub>*This page is licensed: GPLv2, originally from*</sub> [<sub>*fill\_help\_tables.sql*</sub>](https://github.com/MariaDB/server/blob/main/scripts/fill_help_tables.sql)

{% @marketo/form formId="4316" %}
