©SQL :: Manager
HomeProgram InformationTechnical detailsFree downloadDonate for a cup of coffee
myway SQL Manager for MySQL and MariaDB, Download on Uptodown
SQL functionMySQLMariaDB

MariaDB OLD_PASSWORD SQL Function - Generate password

OLD_PASSWORDSyntax:OLD_PASSWORD(String)
Return value:CHAR
Function type:Encryption & Compression
Function Description

The OLD_PASSWORD() function returns the value of the old (pre-MySQL 4.1) implementation of PASSWORD() as a string.

The feature allows to reset passwords for all pre-MySQL 4.1 clients that need to connect to a newer MySQL server, or any version of MariaDB, without locking them.


The OLD_PASSWORD() function returns a hashed password string computed from "String".

The return value is a string in the connection's character set.

Numeric values ​​are interpreted as a character string.

If "String" contains no characters, the function returns an empty string.

If the value of "String" is NULL, the OLD_PASSWORD() function returns NULL.


MySQL does not support this MariaDB feature.

SQL Examples for the OLD_PASSWORD function

 1
 2
 3
 4
 5
 6
 7
 8
 9

SELECT OLD_password('Test');
SELECT OLD_password('New Password');
SELECT OLD_password(54321);

SELECT OLD_password(' ');
SELECT OLD_password('');
SELECT OLD_password(null);

old_password('Test')
varchar(16) BINARY
32b221de7c8362f3
old_password('New Password')
varchar(16) BINARY
1afc4f476a97e6ca
old_password(54321)
varchar(16) BINARY
3326860515a1ecb6
old_password(' ')
varchar(16) BINARY
5030573512345671
old_password('')
varchar(16) BINARY
 
old_password(null)
varchar(16) BINARY
NULL
The examples were created with the MyWAY SQL manager: Download

How to use the OLD_PASSWORD() function in MySQL and MariaDB databases

In MariaDB the OLD_PASSWORD() function is used to hash a password using the old password hashing algorithm before MySQL Version 4.1 to calculate. This feature is for backwards compatibility with older MySQL versions. The function takes a string (password) as input and returns the hash value as a string with hexadecimal representation using the old password hashing algorithm. The feature should generally be avoided in favor of more secure password hashing algorithms, such as the native MariaDB password hashing algorithm of the PASSWORD() function or stronger algorithms like bcrypt or Argon2. The old password hashing algorithm used by OLD_PASSWORD() is not considered secure and has known vulnerabilities.
NVL2OCTOCTET_LENGTHOLD_PASSWORDORDPASSWORDPI

Further MySQL und MariaDB SQL Encryption & Compression

AES_DECRYPTAES_DECRYPT(String, Key)
More about AES_DECRYPT Function

AES_ENCRYPTAES_ENCRYPT(String, Key)
More about AES_ENCRYPT Function

COMPRESSCOMPRESS(String)
More about COMPRESS Function

DECODEDECODE(Binary string, Password)
More about DECODE Function

DES_DECRYPTDES_DECRYPT(Binary string [, Key])
More about DES_DECRYPT Function

DES_ENCRYPTDES_ENCRYPT(String [, Key])
More about DES_ENCRYPT Function

ENCODEENCODE(String, Password)
More about ENCODE Function

ENCRYPTENCRYPT(String [, Salt])
More about ENCRYPT Function

FROM_BASE64FROM_BASE64(String)
More about FROM_BASE64 Function

MD5MD5(String)
More about MD5 Function

PASSWORDPASSWORD(String)
More about PASSWORD Function

RANDOM_BYTESRANDOM_BYTES(Length)
More about RANDOM_BYTES Function

SHASHA(String)
More about SHA Function

SHA1SHA1(String)
More about SHA1 Function

SHA2SHA2(String, Length)
More about SHA2 Function

TO_BASE64TO_BASE64(String)
More about TO_BASE64 Function

UNCOMPRESSUNCOMPRESS(Binary string)
More about UNCOMPRESS Function

Numeric functionsString functionsRegular ExpressionsDate and Time functions
Comparison functionsEncryption & CompressionConversion functionsNULL functions
Aggregate functionsWindow functionsJSON functionsGeometric functions
Sequence functionsInformation functionsDynamic ColumnsMiscellaneous functions
More information about the OLD_PASSWORD SQL function: mysql.com and mariadb.com
Updated: 2023-09-17ImprintContactTerms & conditionsPrivacy & CookiesUpdatesSitemapFacebookLinkedinTwitterStatistics©2020-2024 Heino Cunze-Fischer