In MySQL SERVER 8.0 the PASSWORD function not working

If you need a replacement hash to match the password() function, use this: SHA1(UNHEX(SHA1())); E.g. mysql> SELECT PASSWORD(‘mypass’); +——————————————-+ | PASSWORD(‘mypass’) | +——————————————-+ | *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 | +——————————————-+ and replacement that gives the same answer in version 8: mysql> SELECT CONCAT(‘*’, UPPER(SHA1(UNHEX(SHA1(‘mypass’))))); +————————————————-+ | CONCAT(‘*’, UPPER(SHA1(UNHEX(SHA1(‘mypass’))))) | +————————————————-+ | *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 | +————————————————-+

Node.js can’t authenticate to MySQL 8.0

MySQL 8.0 uses a new default authentication plugin – caching_sha2_password – whereas MySQL 5.7 used a different one – mysql_native_password. Currently, the community Node.js drivers for MySQL don’t support compatible client-side authentication mechanisms for the new server plugin. A possible workaround is to alter the type of user account to use the old authentication plugin: … Read more

phpMyAdmin on MySQL 8.0 [duplicate]

Log in to MySQL console with root user: root@9532f0da1a2a:/# mysql -u root -pPASSWORD and change the Authentication Plugin with the password there: mysql> ALTER USER root IDENTIFIED WITH mysql_native_password BY ‘PASSWORD’; Query OK, 0 rows affected (0.08 sec) You can read more info about the Preferred Authentication Plugin on the MySQL 8.0 Reference Manual https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password … Read more

How to grant all privileges to root user in MySQL 8.0

Starting with MySQL 8 you no longer can (implicitly) create a user using the GRANT command. Use CREATE USER instead, followed by the GRANT statement: mysql> CREATE USER ‘root’@’%’ IDENTIFIED BY ‘PASSWORD’; mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ WITH GRANT OPTION; mysql> FLUSH PRIVILEGES; Caution about the security risks about WITH GRANT OPTION, … Read more

PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client [duplicate]

@mohammed, this is usually attributed to the authentication plugin that your mysql database is using. By default and for some reason, mysql 8 default plugin is auth_socket. Applications will most times expect to log in to your database using a password. If you have not yet already changed your mysql default authentication plugin, you can … Read more

How do you use the “WITH” clause in MySQL?

MySQL prior to version 8.0 doesn’t support the WITH clause (CTE in SQL Server parlance; Subquery Factoring in Oracle), so you are left with using: TEMPORARY tables DERIVED tables inline views (effectively what the WITH clause represents – they are interchangeable) The request for the feature dates back to 2006. As mentioned, you provided a … Read more