create user test1@'%' identified via parsec using 'pwd'; ERROR HY000: Wrong ext-salt format
create user test1@'%' identified via parsec using PASSWORD('pwd');
show grants for test1@'%';
Grants for test1@%
GRANT USAGE ON *.* TO `test1`@`%` IDENTIFIED VIA parsec USING 'P0:salt:password'
connect con1, localhost, test1, pwd;
select 1, USER(), CURRENT_USER(); 1 USER() CURRENT_USER() 1 test1@localhost test1@%
disconnect con1;
connect con2, localhost, test1, pwd;
select 2, USER(), CURRENT_USER(); 2 USER() CURRENT_USER() 2 test1@localhost test1@%
disconnect con2;
connect(localhost,test1,wrong_pwd,test,MASTER_MYPORT,MASTER_MYSOCK);
connect con3, localhost, test1, wrong_pwd; ERROR28000: Access denied for user 'test1'@'localhost' (using password: NO)
connection default;
create function have_ssl() returns char(3) return (select if(variable_value > '','yes','no') as 'have_ssl'
from information_schema.session_status
where variable_name='ssl_cipher');
grant execute on test.* to test1@'%';
# mysql -utest1 -ppwd --ssl-verify-server-cert -e "select test.have_ssl()"
test.have_ssl()
yes
drop function have_ssl;
drop user test1@'%';
# MDEV-34854 Parsec sends garbage when using an empty password
create user test2@'%' identified via parsec using PASSWORD('');
show grants for test2@'%';
Grants for test2@%
GRANT USAGE ON *.* TO `test2`@`%` IDENTIFIED VIA parsec USING 'P0:salt:password'
connect con4, localhost, test2,;
select 4, USER(), CURRENT_USER(); 4 USER() CURRENT_USER() 4 test2@localhost test2@%
disconnect con4;
connect(localhost,test2,wrong_pwd,test,MASTER_MYPORT,MASTER_MYSOCK);
connect con5, localhost, test2, "wrong_pwd"; ERROR28000: Access denied for user 'test2'@'localhost' (using password: NO)
connection default;
drop user test2@'%';
#
# MDEV-35254 PARSEC plugin should allow DBAs to specify number of iterations
#
# Basic visibility and default value set @init_value := @@global.parsec_iterations;
# Valid power-of-two values should be accepted set global parsec_iterations = 1024;
select @@global.parsec_iterations;
@@global.parsec_iterations 1024 set global parsec_iterations = 262144;
select @@global.parsec_iterations;
@@global.parsec_iterations 262144
# Values should be rounded UP to next power of two
# 5000 -> 8192 set global parsec_iterations = 5000;
Warnings:
Warning 1231 parsec_iterations rounded up to 8192
select @@global.parsec_iterations;
@@global.parsec_iterations 8192
# 131073 -> 262144 set global parsec_iterations = 131073;
Warnings:
Warning 1231 parsec_iterations rounded up to 262144
select @@global.parsec_iterations;
@@global.parsec_iterations 262144
# Lower bound enforcement set global parsec_iterations = 512;
Warnings:
Warning 1292 Truncated incorrect parsec_iterations value: '512'
select @@global.parsec_iterations;
@@global.parsec_iterations 1024
# Upper bound enforcement set global parsec_iterations = 2147483649;
Warnings:
Warning 1292 Truncated incorrect parsec_iterations value: '2147483649'
select @@global.parsec_iterations;
@@global.parsec_iterations 1073741824
# Session variable access set session parsec_iterations = 1024;
select @@session.parsec_iterations;
@@session.parsec_iterations 1024
# parsec_iterations should not get accidently mutated during user creation set @iter_before_global := @@global.parsec_iterations; set @iter_before_session := @@session.parsec_iterations;
create user t_iter@'%' identified via parsec using password('pwd');
select @@global.parsec_iterations = @iter_before_global;
@@global.parsec_iterations = @iter_before_global 1
select @@session.parsec_iterations = @iter_before_session;
@@session.parsec_iterations = @iter_before_session 1
drop user t_iter@'%';
# Verify the iteration character encoded in the password hash is correct
# --- 1024 iterations: expect iter char '0' --- set session parsec_iterations = 1024;
create user t_iter@'%' identified via parsec using password('pwd');
select left(json_value(Priv, '$.authentication_string'), 2) from mysql.global_priv where user='t_iter';
left(json_value(Priv, '$.authentication_string'), 2)
P0
drop user t_iter@'%';
# --- 8192 iterations: expect iter char '3' --- set session parsec_iterations = 8192;
create user t_iter@'%' identified via parsec using password('pwd');
select left(json_value(Priv, '$.authentication_string'), 2) from mysql.global_priv where user='t_iter';
left(json_value(Priv, '$.authentication_string'), 2)
P3
drop user t_iter@'%';
# --- 262147 iterations: expect iter char '9' --- set session parsec_iterations = 262147;
Warnings:
Warning 1231 parsec_iterations rounded up to 524288
create user t_iter@'%' identified via parsec using password('pwd');
select left(json_value(Priv, '$.authentication_string'), 2) from mysql.global_priv where user='t_iter';
left(json_value(Priv, '$.authentication_string'), 2)
P9
drop user t_iter@'%'; set global parsec_iterations = @init_value;
# connection test set session parsec_iterations = 65536;
create user test1@'%' identified via parsec using password('pwd');
show grants for test1@'%';
Grants for test1@%
GRANT USAGE ON *.* TO `test1`@`%` IDENTIFIED VIA parsec USING 'P6:salt:password'
connect con1, localhost, test1, pwd;
select 1, user(), current_user(); 1 user() current_user() 1 test1@localhost test1@%
disconnect con1;
connection default;
drop user test1@'%';
select * from information_schema.system_variables where variable_name like 'parsec%';
VARIABLE_NAME PARSEC_ITERATIONS
SESSION_VALUE 65536
GLOBAL_VALUE 1024
GLOBAL_VALUE_ORIGIN SQL
DEFAULT_VALUE 1024
VARIABLE_SCOPE SESSION
VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Number of iterations to be used when generating the key corresponding to the password. Will be rounded up to a power of two
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
IS_DEPRECATED NO
DEPRECATED_REPLACEMENT NULL
# End of parsec.test
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.26 Sekunden
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.