

===========================================================================================================================================
Checking the password authentication using the mysql_old_password plugin at the client and mysql_native_password plugin at the server side
===========================================================================================================================================

select @@Global.old_passwords;
@@Global.old_passwords
0
0 Expected
select @@session.old_passwords;
@@session.old_passwords
0
0 Expected
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'mysql_old_password';
CREATE USER 'Tanjotuser2'@'127.0.0.1' IDENTIFIED WITH 'mysql_old_password';
select (select plugin from mysql.user where User='Tanjotuser1' and Host='localhost')='mysql_old_password';
(select plugin from mysql.user where User='Tanjotuser1' and Host='localhost')='mysql_old_password'
1
1 Expected
select (select plugin from mysql.user where User='Tanjotuser2' and Host='127.0.0.1')='mysql_old_password';
(select plugin from mysql.user where User='Tanjotuser2' and Host='127.0.0.1')='mysql_old_password'
1
1 Expected
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser1'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser2'@'localhost' has a password in the old format; please change the password to the new format
SET @@session.old_passwords=1;
SET PASSWORD FOR 'Tanjotuser1'@'localhost'=PASSWORD('abc');
Warnings:
Warning	1287	'pre-4.1 password hash' is deprecated and will be removed in a future release. Please use post-4.1 password hash instead
SET PASSWORD FOR 'Tanjotuser2'@'127.0.0.1'=PASSWORD('abc');
Warnings:
Warning	1287	'pre-4.1 password hash' is deprecated and will be removed in a future release. Please use post-4.1 password hash instead
set @@global.secure_auth=0;
**** connecting Tanjotuser1 with server 
@@session.old_passwords
1
1 Expected
**** connecting Tanjotuser2 with server 
@@session.old_passwords
1
1 Expected
**** connecting Tanjotuser1 with server 
@@session.old_passwords
1
1 Expected
**** connecting Tanjotuser2 with server 
@@session.old_passwords
1
1 Expected
**** connecting Tanjotuser1 with server 
@@session.old_passwords
1
1 Expected
**** connecting Tanjotuser2 with server 
@@session.old_passwords
1
1 Expected
**** connecting Tanjotuser1 with server 
@@session.old_passwords
1
1 Expected
**** connecting Tanjotuser2 with server 
@@session.old_passwords
1
1 Expected
set @@global.secure_auth=1;
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: )
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser1'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser2'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser1'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser2'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser1'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser2'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser1'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser2'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser1'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser2'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser1'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser2'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser1'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser2'@'localhost' has a password in the old format; please change the password to the new format
select @@global.secure_auth;
@@global.secure_auth
1
1 Expected
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser1'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser2'@'localhost' has a password in the old format; please change the password to the new format
set @@global.secure_auth=0;
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: )
DROP USER 'Tanjotuser1'@'localhost';
DROP USER 'Tanjotuser2'@'127.0.0.1';


====================================================================================================
checking the integrity of long password (more than 40 chars) using mysql_old_password plugin
====================================================================================================

CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'mysql_old_password';
CREATE USER 'Tanjotuser2'@'127.0.0.1' IDENTIFIED WITH 'mysql_old_password';
SET @@session.old_passwords=1;
SET PASSWORD FOR 'Tanjotuser1'@'localhost'=PASSWORD('$$$$$$$$$$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@          @@@@@@@@@@__________');
Warnings:
Warning	1287	'pre-4.1 password hash' is deprecated and will be removed in a future release. Please use post-4.1 password hash instead
SET PASSWORD FOR 'Tanjotuser2'@'127.0.0.1'=PASSWORD('$$$$$$$$$$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@          @@@@@@@@@@__________');
Warnings:
Warning	1287	'pre-4.1 password hash' is deprecated and will be removed in a future release. Please use post-4.1 password hash instead
set @@global.secure_auth=0;
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: )
DROP USER 'Tanjotuser1'@'localhost';
DROP USER 'Tanjotuser2'@'127.0.0.1';


============================================================================================================================================
Checking the password authentication using the mysql_old_password plugin at the client and sha256_password plugin at the server side
============================================================================================================================================

# Restart server with default-authentication-plugin=sha256_password;
select @@Global.old_passwords;
@@Global.old_passwords
2
2 Expected
select @@session.old_passwords;
@@session.old_passwords
0
0 Expected
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'mysql_old_password';
CREATE USER 'Tanjotuser2'@'127.0.0.1' IDENTIFIED WITH 'mysql_old_password';
select (select plugin from mysql.user where User='Tanjotuser1' and Host='localhost')='mysql_old_password';
(select plugin from mysql.user where User='Tanjotuser1' and Host='localhost')='mysql_old_password'
1
1 Expected
select (select plugin from mysql.user where User='Tanjotuser2' and Host='127.0.0.1')='mysql_old_password';
(select plugin from mysql.user where User='Tanjotuser2' and Host='127.0.0.1')='mysql_old_password'
1
1 Expected
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser1'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser2'@'localhost' has a password in the old format; please change the password to the new format
SET @@session.old_passwords=1;
SET PASSWORD FOR 'Tanjotuser1'@'localhost'=PASSWORD('abc');
Warnings:
Warning	1287	'pre-4.1 password hash' is deprecated and will be removed in a future release. Please use post-4.1 password hash instead
SET PASSWORD FOR 'Tanjotuser2'@'127.0.0.1'=PASSWORD('abc');
Warnings:
Warning	1287	'pre-4.1 password hash' is deprecated and will be removed in a future release. Please use post-4.1 password hash instead
set @@global.secure_auth=0;
**** connecting Tanjotuser1 with server 
@@session.old_passwords
1
1 Expected
**** connecting Tanjotuser2 with server 
@@session.old_passwords
1
1 Expected
**** connecting Tanjotuser1 with server 
@@session.old_passwords
1
1 Expected
**** connecting Tanjotuser2 with server 
@@session.old_passwords
1
1 Expected
**** connecting Tanjotuser1 with server 
@@session.old_passwords
1
1 Expected
**** connecting Tanjotuser2 with server 
@@session.old_passwords
1
1 Expected
**** connecting Tanjotuser1 with server 
@@session.old_passwords
1
1 Expected
**** connecting Tanjotuser2 with server 
@@session.old_passwords
1
1 Expected
set @@global.secure_auth=1;
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: )
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser1'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser2'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser1'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser2'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser1'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser2'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser1'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser2'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser1'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser2'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser1'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser2'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser1'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser2'@'localhost' has a password in the old format; please change the password to the new format
select @@global.secure_auth;
@@global.secure_auth
1
1 Expected
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser1'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'Tanjotuser2'@'localhost' has a password in the old format; please change the password to the new format
set @@global.secure_auth=0;
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: )
DROP USER 'Tanjotuser1'@'localhost';
DROP USER 'Tanjotuser2'@'127.0.0.1';


====================================================================================================
checking the integrity of long password (more than 40 chars) using mysql_old_password plugin
====================================================================================================

CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'mysql_old_password';
CREATE USER 'Tanjotuser2'@'127.0.0.1' IDENTIFIED WITH 'mysql_old_password';
SET @@session.old_passwords=1;
SET PASSWORD FOR 'Tanjotuser1'@'localhost'=PASSWORD('$$$$$$$$$$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@          @@@@@@@@@@__________');
Warnings:
Warning	1287	'pre-4.1 password hash' is deprecated and will be removed in a future release. Please use post-4.1 password hash instead
SET PASSWORD FOR 'Tanjotuser2'@'127.0.0.1'=PASSWORD('$$$$$$$$$$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@          @@@@@@@@@@__________');
Warnings:
Warning	1287	'pre-4.1 password hash' is deprecated and will be removed in a future release. Please use post-4.1 password hash instead
set @@global.secure_auth=0;
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: )
ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: )
DROP USER 'Tanjotuser1'@'localhost';
DROP USER 'Tanjotuser2'@'127.0.0.1';
