Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated PASSWORD() function #58341

Open
dveeden opened this issue Dec 17, 2024 · 3 comments · May be fixed by #58346
Open

Remove deprecated PASSWORD() function #58341

dveeden opened this issue Dec 17, 2024 · 3 comments · May be fixed by #58346
Assignees
Labels
compatibility-mysql8 This is a compatibility issue with MySQL 8.0(but NOT 5.7) type/compatibility

Comments

@dveeden
Copy link
Contributor

dveeden commented Dec 17, 2024

Description

          > This function is deprecated in MySQL 5.7 and is removed in MySQL 8.0.

Should we rename it to password or just remove it?

I found it included by #2680, @XuHuaiyu PTAL

Originally posted by @Defined2014 in #58312 (comment)

The PASSWORD() function was used in MySQL 5.7 and before to create passwords for mysql_native_password and sha256_password. And at some point before MySQL 5.7 it also supported pre-4.1 authentication.

Reasons for removal:

  • MySQL 8.0 removes it
  • The PASSWORD() function doesn't work for caching_sha2_password
  • Using the PASSWORD() function to directly update the mysql.user would circumvent password rules.
  • Using the PASSWORD() function to create a hash which then gets used in ... IDENTIFIED AS ... might also circumvent password rules.

This seem to have been deprecated since TiDB version v2.0.0-rc.3

Related

@dveeden dveeden self-assigned this Dec 17, 2024
@dveeden dveeden added type/compatibility compatibility-mysql8 This is a compatibility issue with MySQL 8.0(but NOT 5.7) labels Dec 17, 2024
@dveeden dveeden changed the title > This function is deprecated in MySQL 5.7 and is removed in MySQL 8.0. Remove deprecated PASSWORD() function Dec 17, 2024
@CbcWestwolf
Copy link
Member

@ljun0712 PTAL

@ljun0712
Copy link

LGTM. Please modify the product documentation simultaneously.

@dveeden
Copy link
Contributor Author

dveeden commented Dec 19, 2024

To show that this has been deprecated for a long time, this is TiDB v3.0.0, which is the oldest version that I can easily run via tiup playground.

mysql-5.7.25-TiDB-v3.0.0> SELECT PASSWORD("you_will_never_guess");
+-------------------------------------------+
| PASSWORD("you_will_never_guess")          |
+-------------------------------------------+
| *A84BC1C74C11FE9E22EFC9DAFDF14C975011E489 |
+-------------------------------------------+
1 row in set, 1 warning (0.00 sec)

mysql-5.7.25-TiDB-v3.0.0> SHOW WARNINGS;
+---------+------+-------------------------------------------------------------------+
| Level   | Code | Message                                                           |
+---------+------+-------------------------------------------------------------------+
| Warning | 1681 | 'PASSWORD' is deprecated and will be removed in a future release. |
+---------+------+-------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql-5.7.25-TiDB-v3.0.0> SELECT TIDB_VERSION()\G
*************************** 1. row ***************************
TIDB_VERSION(): Release Version: v3.0.0
Git Commit Hash: 60965b006877ca7234adaced7890d7b029ed1306
Git Branch: HEAD
UTC Build Time: 2019-06-28 12:14:07
GoVersion: go version go1.12 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.01 sec)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility-mysql8 This is a compatibility issue with MySQL 8.0(but NOT 5.7) type/compatibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants