include/master-slave.inc Warnings: Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] # # WL#6409: CREATE/ALTER USER # # CREATE USER CREATE USER user1; SELECT host,user,plugin FROM mysql.user WHERE user = 'user1'; host % user user1 plugin caching_sha2_password CREATE USER user3@%; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%' at line 1 CREATE USER user3@localhost BY 'auth_string' WITH 'mysql_native_password'; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BY 'auth_string' WITH 'mysql_native_password'' at line 1 CREATE USER "user2"@'%'; SELECT host,user,plugin FROM mysql.user WHERE user='user2'; host % user user2 plugin caching_sha2_password CREATE USER u1@localhost; SELECT user,plugin FROM mysql.user WHERE USER='u1'; user u1 plugin caching_sha2_password CREATE USER u2@localhost IDENTIFIED BY 'auth_string' ACCOUNT LOCK; SELECT user,plugin FROM mysql.user WHERE USER='u2'; user u2 plugin caching_sha2_password CREATE USER user5@localhost IDENTIFIED AS 'auth_string'; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS 'auth_string'' at line 1 CREATE USER u3@localhost IDENTIFIED WITH 'mysql_native_password'; SELECT user,plugin FROM mysql.user WHERE USER='u3'; user u3 plugin mysql_native_password CREATE USER u4@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string'; SELECT user,plugin FROM mysql.user WHERE USER='u4'; user u4 plugin mysql_native_password SELECT USER(); USER() u4@localhost CREATE USER user4@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string'; SELECT user,plugin FROM mysql.user WHERE USER='user4'; user user4 plugin mysql_native_password CREATE USER user6@localhost IDENTIFIED WITH 'mysql_native_password'; SELECT user,plugin FROM mysql.user WHERE USER='user6'; user user6 plugin mysql_native_password CREATE USER user7@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string#%y' PASSWORD EXPIRE NEVER ACCOUNT UNLOCK; SELECT user,plugin FROM mysql.user WHERE USER='user7'; user user7 plugin mysql_native_password SELECT USER(); USER() user7@localhost CREATE USER user8@localhost IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF'; SELECT user,plugin FROM mysql.user WHERE USER='user8'; user user8 plugin mysql_native_password SELECT USER(); USER() user8@localhost CREATE USER tu1@localhost IDENTIFIED WITH 'mysql_native_password'; SELECT user,plugin,password_expired, password_expired FROM mysql.user WHERE USER='tu1'; user tu1 plugin mysql_native_password password_expired N password_expired N CREATE USER tu2@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_@13*'; SELECT user,plugin, password_expired FROM mysql.user WHERE USER='tu2'; user tu2 plugin mysql_native_password password_expired N CREATE USER tu3@localhost IDENTIFIED WITH 'mysql_native_password' BY '%auth_O0s-tring'; SELECT user,plugin,password_expired FROM mysql.user WHERE USER='tu3'; user tu3 plugin mysql_native_password password_expired N CREATE USER u5@localhost REQUIRE SSL; SELECT user,plugin,ssl_type FROM mysql.user WHERE USER='u5'; user u5 plugin caching_sha2_password ssl_type ANY CREATE USER u6@localhost IDENTIFIED BY 'auth_string' REQUIRE X509; SELECT user,plugin,ssl_type FROM mysql.user WHERE USER='u6'; user u6 plugin caching_sha2_password ssl_type X509 CREATE USER tu4@localhost IDENTIFIED WITH 'mysql_native_password' BY 'djgsj743$' REQUIRE SSL; SELECT user,plugin,ssl_type FROM mysql.user WHERE USER='tu4'; user tu4 plugin mysql_native_password ssl_type ANY CREATE USER tu5@localhost IDENTIFIED WITH 'mysql_native_password' BY 'dwh@#ghd$!' REQUIRE X509; SELECT user,plugin,ssl_type FROM mysql.user WHERE USER='tu5'; user tu5 plugin mysql_native_password ssl_type X509 CREATE USER u7@localhost IDENTIFIED WITH 'mysql_native_password' REQUIRE CIPHER 'cipher'; SELECT user,plugin,ssl_type,ssl_cipher, x509_issuer,x509_subject FROM mysql.user WHERE USER='u7'; user u7 plugin mysql_native_password ssl_type SPECIFIED ssl_cipher cipher x509_issuer x509_subject CREATE USER u8@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string' REQUIRE ISSUER '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA'; SELECT user,plugin,ssl_type,ssl_cipher, x509_issuer,x509_subject FROM mysql.user WHERE USER='u8'; user u8 plugin mysql_native_password ssl_type SPECIFIED ssl_cipher x509_issuer /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA x509_subject CREATE USER u9@localhost REQUIRE SUBJECT 'sub'; SELECT user,plugin,ssl_type,ssl_cipher, x509_issuer,x509_subject FROM mysql.user WHERE USER='u9'; user u9 plugin caching_sha2_password ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject sub CREATE USER u10@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string#y' REQUIRE CIPHER "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client" ISSUER "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA"; SELECT user,plugin,ssl_type,ssl_cipher, x509_issuer,x509_subject FROM mysql.user WHERE USER='u10'; user u10 plugin mysql_native_password ssl_type SPECIFIED ssl_cipher DHE-RSA-AES256-SHA x509_issuer /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client SELECT USER(); USER() u10@localhost CREATE USER tu6@localhost IDENTIFIED WITH 'mysql_native_password' BY '#hGrt0O6' REQUIRE CIPHER "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client" ISSUER "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA" WITH MAX_QUERIES_PER_HOUR 2 MAX_USER_CONNECTIONS 2; SELECT user,plugin,ssl_type,ssl_cipher,x509_issuer, x509_subject,max_questions,max_user_connections FROM mysql.user WHERE USER='tu6'; user tu6 plugin mysql_native_password ssl_type SPECIFIED ssl_cipher DHE-RSA-AES256-SHA x509_issuer /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client max_questions 2 max_user_connections 2 CREATE USER u11@localhost WITH MAX_QUERIES_PER_HOUR 2; SELECT user,plugin,max_questions FROM mysql.user WHERE USER='u11'; user u11 plugin caching_sha2_password max_questions 2 CREATE USER u12@localhost IDENTIFIED BY 'auth_string' WITH MAX_QUERIES_PER_HOUR 2; SELECT user,plugin,max_questions FROM mysql.user WHERE USER='u12'; user u12 plugin caching_sha2_password max_questions 2 CREATE USER u13@localhost IDENTIFIED WITH 'mysql_native_password' WITH MAX_CONNECTIONS_PER_HOUR 2; SELECT user,plugin,max_connections FROM mysql.user WHERE USER='u13'; user u13 plugin mysql_native_password max_connections 2 CREATE USER u14@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string' WITH MAX_USER_CONNECTIONS 2 ACCOUNT LOCK; SELECT user,plugin,max_user_connections FROM mysql.user WHERE USER='u14'; user u14 plugin mysql_native_password max_user_connections 2 CREATE USER u15@localhost, u16@localhost IDENTIFIED BY 'auth_string', u17@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string'; SELECT user,plugin FROM mysql.user WHERE USER='u15'; user u15 plugin caching_sha2_password SELECT user,plugin FROM mysql.user WHERE USER='u16'; user u16 plugin caching_sha2_password SELECT user,plugin FROM mysql.user WHERE USER='u17'; user u17 plugin mysql_native_password CREATE USER u18@localhost, u19@localhost IDENTIFIED BY 'auth_string', u20@localhost IDENTIFIED WITH 'mysql_native_password', u21@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string', u22@localhost IDENTIFIED WITH 'mysql_native_password', u23@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_&string' REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client' WITH MAX_QUERIES_PER_HOUR 2 MAX_USER_CONNECTIONS 2 ACCOUNT UNLOCK; SELECT user,plugin,ssl_type,ssl_cipher, x509_issuer,x509_subject,max_questions,max_user_connections FROM mysql.user WHERE USER='u18'; user u18 plugin caching_sha2_password ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client max_questions 2 max_user_connections 2 SELECT user,plugin,ssl_type,ssl_cipher, x509_issuer,x509_subject,max_questions,max_user_connections FROM mysql.user WHERE USER='u19'; user u19 plugin caching_sha2_password ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client max_questions 2 max_user_connections 2 SELECT user,plugin,ssl_type,ssl_cipher, x509_issuer,x509_subject,max_questions,max_user_connections FROM mysql.user WHERE USER='u20'; user u20 plugin mysql_native_password ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client max_questions 2 max_user_connections 2 SELECT user,plugin,ssl_type,ssl_cipher, x509_issuer,x509_subject,max_questions,max_user_connections FROM mysql.user WHERE USER='u22'; user u22 plugin mysql_native_password ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client max_questions 2 max_user_connections 2 SELECT user,plugin,ssl_type,ssl_cipher, x509_issuer,x509_subject,max_questions,max_user_connections FROM mysql.user WHERE USER='u23'; user u23 plugin mysql_native_password ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client max_questions 2 max_user_connections 2 DROP USER tu1@localhost,tu2@localhost,tu3@localhost,tu4@localhost,tu5@localhost, tu6@localhost,user1@'%',user2@'%',user4@localhost,user6@localhost, user7@localhost,user8@localhost, u1@localhost,u2@localhost,u3@localhost, u4@localhost,u5@localhost,u6@localhost, u7@localhost, u8@localhost, u9@localhost, u10@localhost,u11@localhost, u12@localhost,u13@localhost, u14@localhost,u15@localhost,u16@localhost,u17@localhost,u18@localhost, u19@localhost, u20@localhost,u21@localhost,u22@localhost,u23@localhost; # ALTER USER CREATE USER u1@localhost; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u1'; user u1 ssl_type ssl_cipher x509_issuer x509_subject plugin caching_sha2_password password_expired N password_last_changed # password_lifetime NULL # Its a no op ALTER USER u1@localhost; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u1'; user u1 ssl_type ssl_cipher x509_issuer x509_subject plugin caching_sha2_password password_expired N password_last_changed # password_lifetime NULL CREATE USER u2@localhost IDENTIFIED BY 'password_string'; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u2'; user u2 ssl_type ssl_cipher x509_issuer x509_subject plugin caching_sha2_password password_expired N password_last_changed # password_lifetime NULL ALTER USER u2@localhost IDENTIFIED BY 'new_auth_string'; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u2'; user u2 ssl_type ssl_cipher x509_issuer x509_subject plugin caching_sha2_password password_expired N password_last_changed # password_lifetime NULL SELECT USER(); USER() u2@localhost CREATE USER u3@localhost IDENTIFIED WITH 'mysql_native_password' ACCOUNT LOCK; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u3'; user u3 ssl_type ssl_cipher x509_issuer x509_subject plugin mysql_native_password password_expired N password_last_changed # password_lifetime NULL ALTER USER u3@localhost IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' PASSWORD EXPIRE NEVER ACCOUNT UNLOCK; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u3'; user u3 ssl_type ssl_cipher x509_issuer x509_subject plugin mysql_native_password password_expired N password_last_changed # password_lifetime 0 SELECT USER(); USER() u3@localhost ALTER USER u3@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string'; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u3'; user u3 ssl_type ssl_cipher x509_issuer x509_subject plugin mysql_native_password password_expired N password_last_changed # password_lifetime 0 ALTER USER u3@localhost REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client' WITH MAX_QUERIES_PER_HOUR 2 MAX_USER_CONNECTIONS 2 PASSWORD EXPIRE NEVER; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u3'; user u3 ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client plugin mysql_native_password password_expired N password_last_changed # password_lifetime 0 CREATE USER u4@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string' ACCOUNT LOCK PASSWORD EXPIRE DEFAULT; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u4'; user u4 ssl_type ssl_cipher x509_issuer x509_subject plugin mysql_native_password password_expired N password_last_changed # password_lifetime NULL ALTER USER u4@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string' ACCOUNT UNLOCK; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u4'; user u4 ssl_type ssl_cipher x509_issuer x509_subject plugin mysql_native_password password_expired N password_last_changed # password_lifetime NULL CREATE USER u5@localhost REQUIRE SSL; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u5'; user u5 ssl_type ANY ssl_cipher x509_issuer x509_subject plugin caching_sha2_password password_expired N password_last_changed # password_lifetime NULL ALTER USER u5@localhost IDENTIFIED WITH 'mysql_native_password'; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u5'; user u5 ssl_type ANY ssl_cipher x509_issuer x509_subject plugin mysql_native_password password_expired Y password_last_changed # password_lifetime NULL SET PASSWORD='new_auth_string'; SELECT USER(); USER() u5@localhost CREATE USER u6@localhost IDENTIFIED BY 'auth_string' REQUIRE X509 ACCOUNT UNLOCK ACCOUNT LOCK PASSWORD EXPIRE INTERVAL 80 DAY; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u6'; user u6 ssl_type X509 ssl_cipher x509_issuer x509_subject plugin caching_sha2_password password_expired N password_last_changed # password_lifetime 80 ALTER USER u6@localhost IDENTIFIED WITH 'mysql_native_password' BY 'new_auth_string' REQUIRE SSL ACCOUNT UNLOCK; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u6'; user u6 ssl_type ANY ssl_cipher x509_issuer x509_subject plugin mysql_native_password password_expired N password_last_changed # password_lifetime 80 CREATE USER u7@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string' REQUIRE CIPHER 'DHE-RSA-AES256-SHA'; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u7'; user u7 ssl_type SPECIFIED ssl_cipher DHE-RSA-AES256-SHA x509_issuer x509_subject plugin mysql_native_password password_expired N password_last_changed # password_lifetime NULL ALTER USER u7@localhost IDENTIFIED WITH 'mysql_native_password' BY 'new_auth_string' REQUIRE ISSUER '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA' ACCOUNT UNLOCK; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u7'; user u7 ssl_type SPECIFIED ssl_cipher x509_issuer /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA x509_subject plugin mysql_native_password password_expired N password_last_changed # password_lifetime NULL SELECT USER(); USER() u7@localhost CREATE USER u8@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string' REQUIRE ISSUER '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA'; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u8'; user u8 ssl_type SPECIFIED ssl_cipher x509_issuer /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA x509_subject plugin mysql_native_password password_expired N password_last_changed # password_lifetime NULL ALTER USER u8@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string' REQUIRE CIPHER "DHE-RSA-AES256-SHA"; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u8'; user u8 ssl_type SPECIFIED ssl_cipher DHE-RSA-AES256-SHA x509_issuer x509_subject plugin mysql_native_password password_expired N password_last_changed # password_lifetime NULL SELECT USER(); USER() u8@localhost CREATE USER tu1@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string' REQUIRE ISSUER 'issuer'; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='tu1'; user tu1 ssl_type SPECIFIED ssl_cipher x509_issuer issuer x509_subject plugin mysql_native_password password_expired N password_last_changed # password_lifetime NULL ALTER USER tu1@localhost IDENTIFIED WITH 'mysql_native_password' REQUIRE CIPHER "DHE-RSA-AES256-SHA"; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='tu1'; user tu1 ssl_type SPECIFIED ssl_cipher DHE-RSA-AES256-SHA x509_issuer x509_subject plugin mysql_native_password password_expired Y password_last_changed # password_lifetime NULL CREATE USER u9@localhost REQUIRE SUBJECT 'sub'; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u9'; user u9 ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject sub plugin caching_sha2_password password_expired N password_last_changed # password_lifetime NULL ALTER USER u9@localhost REQUIRE ISSUER "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA"; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u9'; user u9 ssl_type SPECIFIED ssl_cipher x509_issuer /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA x509_subject plugin caching_sha2_password password_expired N password_last_changed # password_lifetime NULL ALTER USER u9@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string77hg' REQUIRE ISSUER "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA"; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u9'; user u9 ssl_type SPECIFIED ssl_cipher x509_issuer /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA x509_subject plugin mysql_native_password password_expired N password_last_changed # password_lifetime NULL CREATE USER u10@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string' REQUIRE CIPHER "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client" ISSUER "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA"; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u10'; user u10 ssl_type SPECIFIED ssl_cipher DHE-RSA-AES256-SHA x509_issuer /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client plugin mysql_native_password password_expired N password_last_changed # password_lifetime NULL ALTER USER u10@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string' REQUIRE SSL; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u10'; user u10 ssl_type ANY ssl_cipher x509_issuer x509_subject plugin mysql_native_password password_expired N password_last_changed # password_lifetime NULL SELECT USER(); USER() u10@localhost CREATE USER u11@localhost WITH MAX_QUERIES_PER_HOUR 2; SELECT user,max_questions FROM mysql.user WHERE USER='u11'; user u11 max_questions 2 ALTER USER u11@localhost WITH MAX_QUERIES_PER_HOUR 6; SELECT user,max_questions FROM mysql.user WHERE USER='u11'; user u11 max_questions 6 CREATE USER u12@localhost IDENTIFIED BY 'auth_string' WITH MAX_QUERIES_PER_HOUR 2; SELECT user,max_questions FROM mysql.user WHERE USER='u12'; user u12 max_questions 2 ALTER USER u12@localhost IDENTIFIED WITH 'mysql_native_password' WITH MAX_QUERIES_PER_HOUR 8; SELECT user,max_questions FROM mysql.user WHERE USER='u12'; user u12 max_questions 8 ALTER USER u12@localhost IDENTIFIED WITH 'mysql_native_password' WITH MAX_QUERIES_PER_HOUR 1000; SELECT user,max_questions FROM mysql.user WHERE USER='u12'; user u12 max_questions 1000 CREATE USER u13@localhost IDENTIFIED WITH 'mysql_native_password' WITH MAX_CONNECTIONS_PER_HOUR 2; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u13'; user u13 ssl_type ssl_cipher x509_issuer x509_subject plugin mysql_native_password password_expired N password_last_changed # password_lifetime NULL ALTER USER u13@localhost PASSWORD EXPIRE; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u13'; user u13 ssl_type ssl_cipher x509_issuer x509_subject plugin mysql_native_password password_expired Y password_last_changed # password_lifetime NULL CREATE USER u14@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string' WITH MAX_USER_CONNECTIONS 2; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired,max_user_connections, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u14'; user u14 ssl_type ssl_cipher x509_issuer x509_subject plugin mysql_native_password password_expired N max_user_connections 2 password_last_changed # password_lifetime NULL ALTER USER u14@localhost WITH MAX_USER_CONNECTIONS 12 PASSWORD EXPIRE INTERVAL 365 DAY; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired,max_user_connections, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u14'; user u14 ssl_type ssl_cipher x509_issuer x509_subject plugin mysql_native_password password_expired N max_user_connections 12 password_last_changed # password_lifetime 365 CREATE USER tu2@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string' WITH MAX_USER_CONNECTIONS 2 ; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired,max_user_connections,max_questions, password_last_changed,password_lifetime FROM mysql.user WHERE USER='tu2'; user tu2 ssl_type ssl_cipher x509_issuer x509_subject plugin mysql_native_password password_expired N max_user_connections 2 max_questions 0 password_last_changed # password_lifetime NULL ALTER USER tu2@localhost WITH MAX_USER_CONNECTIONS 12 MAX_QUERIES_PER_HOUR 543 PASSWORD EXPIRE INTERVAL 365 DAY; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired,max_user_connections,max_questions, password_last_changed,password_lifetime FROM mysql.user WHERE USER='tu2'; user tu2 ssl_type ssl_cipher x509_issuer x509_subject plugin mysql_native_password password_expired N max_user_connections 12 max_questions 543 password_last_changed # password_lifetime 365 SELECT USER(); USER() tu2@localhost CREATE USER u15@localhost, u16@localhost IDENTIFIED WITH 'mysql_native_password', u17@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string'; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u15'; user u15 ssl_type ssl_cipher x509_issuer x509_subject plugin caching_sha2_password password_expired N password_last_changed # password_lifetime NULL SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u16'; user u16 ssl_type ssl_cipher x509_issuer x509_subject plugin mysql_native_password password_expired N password_last_changed # password_lifetime NULL SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u17'; user u17 ssl_type ssl_cipher x509_issuer x509_subject plugin mysql_native_password password_expired N password_last_changed # password_lifetime NULL ALTER USER u15@localhost IDENTIFIED WITH 'mysql_native_password', u16@localhost, u17@localhost IDENTIFIED BY 'new_auth_string' PASSWORD EXPIRE DEFAULT; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u15'; user u15 ssl_type ssl_cipher x509_issuer x509_subject plugin mysql_native_password password_expired Y password_last_changed # password_lifetime NULL SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u16'; user u16 ssl_type ssl_cipher x509_issuer x509_subject plugin mysql_native_password password_expired N password_last_changed # password_lifetime NULL SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u17'; user u17 ssl_type ssl_cipher x509_issuer x509_subject plugin mysql_native_password password_expired N password_last_changed # password_lifetime NULL CREATE USER u18@localhost, u19@localhost IDENTIFIED BY 'auth_string', u20@localhost IDENTIFIED WITH 'mysql_native_password', u21@localhost IDENTIFIED WITH 'mysql_native_password' BY '!Y_TOdh6)', u22@localhost IDENTIFIED WITH 'mysql_native_password', u23@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_&string' REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client' WITH MAX_QUERIES_PER_HOUR 2 MAX_USER_CONNECTIONS 2; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired,max_user_connections, max_questions,password_last_changed,password_lifetime FROM mysql.user WHERE USER='u18'; user u18 ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client plugin caching_sha2_password password_expired N max_user_connections 2 max_questions 2 password_last_changed # password_lifetime NULL SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired,max_user_connections, max_questions,password_last_changed,password_lifetime FROM mysql.user WHERE USER='u19'; user u19 ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client plugin caching_sha2_password password_expired N max_user_connections 2 max_questions 2 password_last_changed # password_lifetime NULL SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired,max_user_connections, max_questions,password_last_changed,password_lifetime FROM mysql.user WHERE USER='u20'; user u20 ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client plugin mysql_native_password password_expired N max_user_connections 2 max_questions 2 password_last_changed # password_lifetime NULL SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired,max_user_connections, max_questions,password_last_changed,password_lifetime FROM mysql.user WHERE USER='u21'; user u21 ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client plugin mysql_native_password password_expired N max_user_connections 2 max_questions 2 password_last_changed # password_lifetime NULL SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired,max_user_connections, max_questions,password_last_changed,password_lifetime FROM mysql.user WHERE USER='u22'; user u22 ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client plugin mysql_native_password password_expired N max_user_connections 2 max_questions 2 password_last_changed # password_lifetime NULL SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired,max_user_connections, max_questions,password_last_changed,password_lifetime FROM mysql.user WHERE USER='u23'; user u23 ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client plugin mysql_native_password password_expired N max_user_connections 2 max_questions 2 password_last_changed # password_lifetime NULL ALTER USER u18@localhost, u19@localhost, u20@localhost, u21@localhost, u22@localhost, u23@localhost REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client' WITH MAX_QUERIES_PER_HOUR 2 MAX_USER_CONNECTIONS 2 PASSWORD EXPIRE NEVER; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired,max_user_connections, max_questions,password_last_changed,password_lifetime FROM mysql.user WHERE USER='u18'; user u18 ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client plugin caching_sha2_password password_expired N max_user_connections 2 max_questions 2 password_last_changed # password_lifetime 0 SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired,max_user_connections, max_questions,password_last_changed,password_lifetime FROM mysql.user WHERE USER='u19'; user u19 ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client plugin caching_sha2_password password_expired N max_user_connections 2 max_questions 2 password_last_changed # password_lifetime 0 SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired,max_user_connections, max_questions,password_last_changed,password_lifetime FROM mysql.user WHERE USER='u20'; user u20 ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client plugin mysql_native_password password_expired N max_user_connections 2 max_questions 2 password_last_changed # password_lifetime 0 SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired,max_user_connections, max_questions,password_last_changed,password_lifetime FROM mysql.user WHERE USER='u21'; user u21 ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client plugin mysql_native_password password_expired N max_user_connections 2 max_questions 2 password_last_changed # password_lifetime 0 SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired,max_user_connections, max_questions,password_last_changed,password_lifetime FROM mysql.user WHERE USER='u22'; user u22 ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client plugin mysql_native_password password_expired N max_user_connections 2 max_questions 2 password_last_changed # password_lifetime 0 SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired,max_user_connections, max_questions,password_last_changed,password_lifetime FROM mysql.user WHERE USER='u23'; user u23 ssl_type SPECIFIED ssl_cipher x509_issuer x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client plugin mysql_native_password password_expired N max_user_connections 2 max_questions 2 password_last_changed # password_lifetime 0 DROP USER tu1@localhost,tu2@localhost,u1@localhost, u2@localhost, u3@localhost, u4@localhost,u5@localhost,u6@localhost, u7@localhost, u8@localhost, u9@localhost,u10@localhost,u11@localhost,u12@localhost,u13@localhost, u14@localhost,u15@localhost,u16@localhost,u17@localhost,u18@localhost, u19@localhost,u20@localhost,u21@localhost,u22@localhost,u23@localhost; # ALTER USER with current user CREATE USER u1@localhost IDENTIFIED BY 'abc'; SELECT USER(); USER() u1@localhost ALTER USER u1@localhost PASSWORD EXPIRE; SELECT USER(); ERROR HY000: You must reset your password using ALTER USER statement before executing this statement. SET PASSWORD = 'def'; SELECT USER(); USER() u1@localhost ALTER USER u1@localhost PASSWORD EXPIRE; SELECT USER(); ERROR HY000: You must reset your password using ALTER USER statement before executing this statement. ALTER USER IDENTIFIED BY 'npwd'; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BY 'npwd'' at line 1 ALTER USER USER() IDENTIFIED BY 'abc'; SELECT USER(); USER() u1@localhost ALTER USER u1@localhost PASSWORD EXPIRE; SELECT USER(); ERROR HY000: You must reset your password using ALTER USER statement before executing this statement. ALTER USER u1@localhost IDENTIFIED BY 'def'; SELECT USER(); USER() u1@localhost DROP USER u1@localhost; # ALTER USER with current user is allowed to set only credential information CREATE USER u1@localhost, u2@localhost IDENTIFIED BY 'abc'; GRANT ALL ON *.* TO u2@localhost; ALTER USER USER() IDENTIFIED WITH 'sha256_password'; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WITH 'sha256_password'' at line 1 ALTER USER USER() IDENTIFIED BY 'def', u2@localhost PASSWORD EXPIRE; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ', u2@localhost PASSWORD EXPIRE' at line 1 ALTER USER USER() IDENTIFIED BY 'def' PASSWORD EXPIRE; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PASSWORD EXPIRE' at line 1 ALTER USER ; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 ALTER USER u2@localhost IDENTIFIED BY 'auth_string' PASSWORD EXPIRE INTERVAL 45 DAY; SELECT user,ssl_type,ssl_cipher,x509_issuer,x509_subject, plugin,password_expired, password_last_changed,password_lifetime FROM mysql.user WHERE USER='u2'; user u2 ssl_type ssl_cipher x509_issuer x509_subject plugin caching_sha2_password password_expired N password_last_changed # password_lifetime 45 DROP USER u1@localhost, u2@localhost; # SHOW CREATE USER CREATE USER u1@localhost; SHOW CREATE USER u1@localhost; CREATE USER for u1@localhost CREATE USER 'u1'@'localhost' IDENTIFIED WITH 'caching_sha2_password' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT CREATE USER u2@localhost IDENTIFIED BY 'auth_string'; SHOW CREATE USER u2@localhost; CREATE USER for u2@localhost CREATE USER 'u2'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT # DDL output for SHOW CREATE USER u2@localhost and recreating user DROP USER u2@localhost; CREATE USER 'u2'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' REQUIRE NONE; SELECT USER(); USER() u2@localhost CREATE USER u3@localhost IDENTIFIED WITH 'mysql_native_password'; SHOW CREATE USER u3@localhost; CREATE USER for u3@localhost CREATE USER 'u3'@'localhost' IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT CREATE USER u4@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string'; SHOW CREATE USER u4@localhost; CREATE USER for u4@localhost CREATE USER 'u4'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT CREATE USER user1@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string'; SHOW CREATE USER user1@localhost; CREATE USER for user1@localhost CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT CREATE USER user2@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string'; SHOW CREATE USER user2@localhost; CREATE USER for user2@localhost CREATE USER 'user2'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT CREATE USER u5@localhost REQUIRE SSL; SHOW CREATE USER u5@localhost; CREATE USER for u5@localhost CREATE USER 'u5'@'localhost' IDENTIFIED WITH 'caching_sha2_password' REQUIRE SSL PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT CREATE USER u6@localhost IDENTIFIED BY 'auth_string' REQUIRE X509; SHOW CREATE USER u6@localhost; CREATE USER for u6@localhost CREATE USER 'u6'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' REQUIRE X509 PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT CREATE USER u7@localhost IDENTIFIED WITH 'mysql_native_password' REQUIRE CIPHER 'cipher'; SHOW CREATE USER u7@localhost; CREATE USER for u7@localhost CREATE USER 'u7'@'localhost' IDENTIFIED WITH 'mysql_native_password' REQUIRE CIPHER 'cipher' PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT CREATE USER u8@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string' REQUIRE ISSUER 'issuer'; SHOW CREATE USER u8@localhost; CREATE USER for u8@localhost CREATE USER 'u8'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '' REQUIRE ISSUER 'issuer' PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT CREATE USER u9@localhost REQUIRE SUBJECT 'sub'; SHOW CREATE USER u9@localhost; CREATE USER for u9@localhost CREATE USER 'u9'@'localhost' IDENTIFIED WITH 'caching_sha2_password' REQUIRE SUBJECT 'sub' PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT CREATE USER u10@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string' REQUIRE CIPHER "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client" ISSUER "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA"; SHOW CREATE USER u10@localhost; CREATE USER for u10@localhost CREATE USER 'u10'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '' REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client' ISSUER '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA' CIPHER 'DHE-RSA-AES256-SHA' PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT CREATE USER u11@localhost WITH MAX_QUERIES_PER_HOUR 2; SHOW CREATE USER u11@localhost; CREATE USER for u11@localhost CREATE USER 'u11'@'localhost' IDENTIFIED WITH 'caching_sha2_password' REQUIRE NONE WITH MAX_QUERIES_PER_HOUR 2 PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT CREATE USER u12@localhost IDENTIFIED BY 'auth_string' WITH MAX_QUERIES_PER_HOUR 2; SHOW CREATE USER u12@localhost; CREATE USER for u12@localhost CREATE USER 'u12'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' REQUIRE NONE WITH MAX_QUERIES_PER_HOUR 2 PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT CREATE USER u13@localhost IDENTIFIED WITH 'mysql_native_password' WITH MAX_CONNECTIONS_PER_HOUR 2; SHOW CREATE USER u13@localhost; CREATE USER for u13@localhost CREATE USER 'u13'@'localhost' IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE WITH MAX_CONNECTIONS_PER_HOUR 2 PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT CREATE USER u14@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string' WITH MAX_USER_CONNECTIONS 2; SHOW CREATE USER u14@localhost; CREATE USER for u14@localhost CREATE USER 'u14'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '' REQUIRE NONE WITH MAX_USER_CONNECTIONS 2 PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT CREATE USER u15@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string' REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client' ISSUER "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA" CIPHER 'cipher' WITH MAX_QUERIES_PER_HOUR 2 MAX_USER_CONNECTIONS 2; SHOW CREATE USER u15@localhost; CREATE USER for u15@localhost CREATE USER 'u15'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '' REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client' ISSUER '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA' CIPHER 'cipher' WITH MAX_QUERIES_PER_HOUR 2 MAX_USER_CONNECTIONS 2 PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT DROP USER user1@localhost,u1@localhost,u2@localhost,u3@localhost,u4@localhost, u5@localhost,u6@localhost, u7@localhost, u8@localhost,u9@localhost, u10@localhost,u11@localhost,u12@localhost,u13@localhost,u14@localhost, u15@localhost; # GRANT CREATE USER user1@localhost IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client' ISSUER "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA" WITH MAX_CONNECTIONS_PER_HOUR 1000 MAX_USER_CONNECTIONS 20 MAX_QUERIES_PER_HOUR 60 MAX_UPDATES_PER_HOUR 100; SELECT user,plugin,ssl_type,ssl_cipher, x509_issuer,x509_subject,max_user_connections, max_questions,max_updates,max_connections FROM mysql.user WHERE USER='user1'; user user1 plugin mysql_native_password ssl_type SPECIFIED ssl_cipher x509_issuer /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client max_user_connections 20 max_questions 60 max_updates 100 max_connections 1000 GRANT SELECT ON *.* TO user1@localhost; GRANT SELECT,INSERT,UPDATE ON mysql.* TO user1@localhost; SHOW GRANTS FOR user1@localhost; Grants for user1@localhost GRANT SELECT ON *.* TO `user1`@`localhost` GRANT SELECT, INSERT, UPDATE ON `mysql`.* TO `user1`@`localhost` REVOKE INSERT,UPDATE ON mysql.* FROM user1@localhost; SHOW GRANTS FOR user1@localhost; Grants for user1@localhost GRANT SELECT ON *.* TO `user1`@`localhost` GRANT SELECT ON `mysql`.* TO `user1`@`localhost` GRANT SELECT,INSERT,UPDATE ON *.* TO user2@localhost; ALTER USER user2@localhost IDENTIFIED BY 'admin' REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client' ISSUER "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA" WITH MAX_CONNECTIONS_PER_HOUR 1000 MAX_USER_CONNECTIONS 20 MAX_QUERIES_PER_HOUR 60 MAX_UPDATES_PER_HOUR 100; SELECT user,plugin,ssl_type,ssl_cipher, x509_issuer,x509_subject,max_user_connections, max_questions,max_updates,max_connections FROM mysql.user WHERE USER='user2'; user user2 plugin mysql_native_password ssl_type SPECIFIED ssl_cipher x509_issuer /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA x509_subject /C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client max_user_connections 20 max_questions 60 max_updates 100 max_connections 1000 CREATE USER user3@localhost IDENTIFIED BY 'auth_string'; # Cleanup DROP USER user1@localhost,user2@localhost,user3@localhost; # SET PASSWORD Tests CREATE USER user1@localhost IDENTIFIED BY 'auth_string'; CREATE USER user2@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string1'; SET PASSWORD FOR user1@localhost='auth_xyz@'; SET PASSWORD FOR user2@localhost='gd636@gj'; CREATE USER user4@localhost; ALTER USER user4@localhost PASSWORD EXPIRE; SET PASSWORD FOR user4@localhost=''; CREATE USER user3@localhost IDENTIFIED BY 'auth_string'; CREATE USER user5@localhost IDENTIFIED WITH 'mysql_native_password' BY 'auth_string1'; SET PASSWORD FOR user3@localhost='auth_abc'; GRANT SELECT ON *.* TO user3@localhost; SELECT USER(); USER() user3@localhost SET PASSWORD='auth_xyz'; SELECT user,plugin,ssl_type,password_expired, password_lifetime FROM mysql.user WHERE user='user3'; user user3 plugin caching_sha2_password ssl_type password_expired N password_lifetime NULL SET PASSWORD FOR user4@localhost='auth_xyz'; SELECT user,plugin,ssl_type,password_expired, password_lifetime FROM mysql.user WHERE user='user4'; user user4 plugin caching_sha2_password ssl_type password_expired N password_lifetime NULL SET PASSWORD FOR user5@localhost='auth_dhsga5'; SELECT user,plugin,ssl_type,password_expired, password_lifetime FROM mysql.user WHERE user='user5'; user user5 plugin mysql_native_password ssl_type password_expired N password_lifetime NULL CREATE USER user6@localhost IDENTIFIED BY 'auth_string'; SELECT user,plugin,password_expired FROM mysql.user WHERE USER='user6'; user user6 plugin caching_sha2_password password_expired N ALTER USER user6@localhost IDENTIFIED WITH 'mysql_native_password'; SELECT user,plugin,password_expired FROM mysql.user WHERE USER='user6'; user user6 plugin mysql_native_password password_expired Y SET PASSWORD FOR user6@localhost='plaintext_password'; SELECT user,plugin FROM mysql.user WHERE USER='user6'; user user6 plugin mysql_native_password SELECT USER(); USER() user6@localhost # Cleanup DROP USER user1@localhost,user2@localhost,user3@localhost, user4@localhost,user5@localhost,user6@localhost; include/sync_slave_sql_with_master.inc [On Slave] include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Query # # use `test`; CREATE USER 'user1'@'%' IDENTIFIED WITH 'caching_sha2_password' slave-bin.000001 # Query # # use `test`; CREATE USER 'user2'@'%' IDENTIFIED WITH 'caching_sha2_password' slave-bin.000001 # Query # # use `test`; CREATE USER 'u1'@'localhost' IDENTIFIED WITH 'caching_sha2_password' slave-bin.000001 # Query # # use `test`; CREATE USER 'u2'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' ACCOUNT LOCK slave-bin.000001 # Query # # use `test`; CREATE USER 'u3'@'localhost' IDENTIFIED WITH 'mysql_native_password' slave-bin.000001 # Query # # use `test`; CREATE USER 'u4'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' slave-bin.000001 # Query # # use `test`; CREATE USER 'user4'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' slave-bin.000001 # Query # # use `test`; CREATE USER 'user6'@'localhost' IDENTIFIED WITH 'mysql_native_password' slave-bin.000001 # Query # # use `test`; CREATE USER 'user7'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*1643D320B9787E87A3C6CE2C953B9E4FDBC048BC' PASSWORD EXPIRE NEVER ACCOUNT UNLOCK slave-bin.000001 # Query # # use `test`; CREATE USER 'user8'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' slave-bin.000001 # Query # # use `test`; CREATE USER 'tu1'@'localhost' IDENTIFIED WITH 'mysql_native_password' slave-bin.000001 # Query # # use `test`; CREATE USER 'tu2'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*688BC28176C50B8E37AB2D9BDFDCC945AD0CAD61' slave-bin.000001 # Query # # use `test`; CREATE USER 'tu3'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*4CB92EE3F6DCB4480A1ED46B0B82E3E6180947D5' slave-bin.000001 # Query # # use `test`; CREATE USER 'u5'@'localhost' IDENTIFIED WITH 'caching_sha2_password' REQUIRE SSL slave-bin.000001 # Query # # use `test`; CREATE USER 'u6'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' REQUIRE X509 slave-bin.000001 # Query # # use `test`; CREATE USER 'tu4'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*0D38B5A8766439BA457E3FDFAF84D794245A1C8B' REQUIRE SSL slave-bin.000001 # Query # # use `test`; CREATE USER 'tu5'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*87CAAC9F8E0664808E450E3E9D4CCCA455FB90F0' REQUIRE X509 slave-bin.000001 # Query # # use `test`; CREATE USER 'u7'@'localhost' IDENTIFIED WITH 'mysql_native_password' REQUIRE CIPHER 'cipher' slave-bin.000001 # Query # # use `test`; CREATE USER 'u8'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' REQUIRE ISSUER '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA' slave-bin.000001 # Query # # use `test`; CREATE USER 'u9'@'localhost' IDENTIFIED WITH 'caching_sha2_password' REQUIRE SUBJECT 'sub' slave-bin.000001 # Query # # use `test`; CREATE USER 'u10'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*D0B4490FF0452CF4EAA50F79F6B06F859FA2B012' REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client' ISSUER '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA' CIPHER 'DHE-RSA-AES256-SHA' slave-bin.000001 # Query # # use `test`; CREATE USER 'tu6'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*6F268C32216139F3B99FEBA90FC68F8D9651382A' REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client' ISSUER '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA' CIPHER 'DHE-RSA-AES256-SHA' WITH MAX_QUERIES_PER_HOUR 2 MAX_USER_CONNECTIONS 2 slave-bin.000001 # Query # # use `test`; CREATE USER 'u11'@'localhost' IDENTIFIED WITH 'caching_sha2_password' WITH MAX_QUERIES_PER_HOUR 2 slave-bin.000001 # Query # # use `test`; CREATE USER 'u12'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' WITH MAX_QUERIES_PER_HOUR 2 slave-bin.000001 # Query # # use `test`; CREATE USER 'u13'@'localhost' IDENTIFIED WITH 'mysql_native_password' WITH MAX_CONNECTIONS_PER_HOUR 2 slave-bin.000001 # Query # # use `test`; CREATE USER 'u14'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' WITH MAX_USER_CONNECTIONS 2 ACCOUNT LOCK slave-bin.000001 # Query # # use `test`; CREATE USER 'u15'@'localhost' IDENTIFIED WITH 'caching_sha2_password','u16'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' slave-bin.000001 # Query # # use `test`; CREATE USER 'u18'@'localhost' IDENTIFIED WITH 'caching_sha2_password','u19'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' WITH MAX_QUERIES_PER_HOUR 2 MAX_USER_CONNECTIONS 2 ACCOUNT UNLOCK slave-bin.000001 # Query # # use `test`; DROP USER tu1@localhost,tu2@localhost,tu3@localhost,tu4@localhost,tu5@localhost, tu6@localhost,user1@'%',user2@'%',user4@localhost,user6@localhost, user7@localhost,user8@localhost, u1@localhost,u2@localhost,u3@localhost, u4@localhost,u5@localhost,u6@localhost, u7@localhost, u8@localhost, u9@localhost, u10@localhost,u11@localhost, u12@localhost,u13@localhost, u14@localhost,u15@localhost,u16@localhost,u17@localhost,u18@localhost, u19@localhost, u20@localhost,u21@localhost,u22@localhost,u23@localhost slave-bin.000001 # Query # # use `test`; CREATE USER 'u1'@'localhost' IDENTIFIED WITH 'caching_sha2_password' slave-bin.000001 # Query # # use `test`; ALTER USER 'u1'@'localhost' slave-bin.000001 # Query # # use `test`; CREATE USER 'u2'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' slave-bin.000001 # Query # # use `test`; ALTER USER 'u2'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' slave-bin.000001 # Query # # use `test`; CREATE USER 'u3'@'localhost' IDENTIFIED WITH 'mysql_native_password' ACCOUNT LOCK slave-bin.000001 # Query # # use `test`; ALTER USER 'u3'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' PASSWORD EXPIRE NEVER ACCOUNT UNLOCK slave-bin.000001 # Query # # use `test`; ALTER USER 'u3'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' slave-bin.000001 # Query # # use `test`; ALTER USER 'u3'@'localhost' REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client' WITH MAX_QUERIES_PER_HOUR 2 MAX_USER_CONNECTIONS 2 PASSWORD EXPIRE NEVER slave-bin.000001 # Query # # use `test`; CREATE USER 'u4'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' PASSWORD EXPIRE DEFAULT ACCOUNT LOCK slave-bin.000001 # Query # # use `test`; ALTER USER 'u4'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' ACCOUNT UNLOCK slave-bin.000001 # Query # # use `test`; CREATE USER 'u5'@'localhost' IDENTIFIED WITH 'caching_sha2_password' REQUIRE SSL slave-bin.000001 # Query # # use `test`; ALTER USER 'u5'@'localhost' IDENTIFIED WITH 'mysql_native_password' slave-bin.000001 # Query # # use `test`; ALTER USER 'u5'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*5B3304C97AB136DEBC2C0B46336F27398F7AEFB6' slave-bin.000001 # Query # # use `test`; CREATE USER 'u6'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' REQUIRE X509 PASSWORD EXPIRE INTERVAL 80 DAY ACCOUNT LOCK slave-bin.000001 # Query # # use `test`; ALTER USER 'u6'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*5B3304C97AB136DEBC2C0B46336F27398F7AEFB6' REQUIRE SSL ACCOUNT UNLOCK slave-bin.000001 # Query # # use `test`; CREATE USER 'u7'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' REQUIRE CIPHER 'DHE-RSA-AES256-SHA' slave-bin.000001 # Query # # use `test`; ALTER USER 'u7'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*5B3304C97AB136DEBC2C0B46336F27398F7AEFB6' REQUIRE ISSUER '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA' ACCOUNT UNLOCK slave-bin.000001 # Query # # use `test`; CREATE USER 'u8'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' REQUIRE ISSUER '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA' slave-bin.000001 # Query # # use `test`; ALTER USER 'u8'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' REQUIRE CIPHER 'DHE-RSA-AES256-SHA' slave-bin.000001 # Query # # use `test`; CREATE USER 'tu1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' REQUIRE ISSUER 'issuer' slave-bin.000001 # Query # # use `test`; ALTER USER 'tu1'@'localhost' IDENTIFIED WITH 'mysql_native_password' REQUIRE CIPHER 'DHE-RSA-AES256-SHA' slave-bin.000001 # Query # # use `test`; CREATE USER 'u9'@'localhost' IDENTIFIED WITH 'caching_sha2_password' REQUIRE SUBJECT 'sub' slave-bin.000001 # Query # # use `test`; ALTER USER 'u9'@'localhost' REQUIRE ISSUER '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA' slave-bin.000001 # Query # # use `test`; ALTER USER 'u9'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*AEEAD8F349FAED7CA659DCEFCEC2F0BF90241263' REQUIRE ISSUER '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA' slave-bin.000001 # Query # # use `test`; CREATE USER 'u10'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client' ISSUER '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA' CIPHER 'DHE-RSA-AES256-SHA' slave-bin.000001 # Query # # use `test`; ALTER USER 'u10'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' REQUIRE SSL slave-bin.000001 # Query # # use `test`; CREATE USER 'u11'@'localhost' IDENTIFIED WITH 'caching_sha2_password' WITH MAX_QUERIES_PER_HOUR 2 slave-bin.000001 # Query # # use `test`; ALTER USER 'u11'@'localhost' WITH MAX_QUERIES_PER_HOUR 6 slave-bin.000001 # Query # # use `test`; CREATE USER 'u12'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' WITH MAX_QUERIES_PER_HOUR 2 slave-bin.000001 # Query # # use `test`; ALTER USER 'u12'@'localhost' IDENTIFIED WITH 'mysql_native_password' WITH MAX_QUERIES_PER_HOUR 8 slave-bin.000001 # Query # # use `test`; ALTER USER 'u12'@'localhost' IDENTIFIED WITH 'mysql_native_password' WITH MAX_QUERIES_PER_HOUR 1000 slave-bin.000001 # Query # # use `test`; CREATE USER 'u13'@'localhost' IDENTIFIED WITH 'mysql_native_password' WITH MAX_CONNECTIONS_PER_HOUR 2 slave-bin.000001 # Query # # use `test`; ALTER USER 'u13'@'localhost' PASSWORD EXPIRE slave-bin.000001 # Query # # use `test`; CREATE USER 'u14'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' WITH MAX_USER_CONNECTIONS 2 slave-bin.000001 # Query # # use `test`; ALTER USER 'u14'@'localhost' WITH MAX_USER_CONNECTIONS 12 PASSWORD EXPIRE INTERVAL 365 DAY slave-bin.000001 # Query # # use `test`; CREATE USER 'tu2'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' WITH MAX_USER_CONNECTIONS 2 slave-bin.000001 # Query # # use `test`; ALTER USER 'tu2'@'localhost' WITH MAX_QUERIES_PER_HOUR 543 MAX_USER_CONNECTIONS 12 PASSWORD EXPIRE INTERVAL 365 DAY slave-bin.000001 # Query # # use `test`; CREATE USER 'u15'@'localhost' IDENTIFIED WITH 'caching_sha2_password','u16'@'localhost' IDENTIFIED WITH 'mysql_native_password','u17'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' slave-bin.000001 # Query # # use `test`; ALTER USER 'u15'@'localhost' IDENTIFIED WITH 'mysql_native_password','u16'@'localhost','u17'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*5B3304C97AB136DEBC2C0B46336F27398F7AEFB6' PASSWORD EXPIRE DEFAULT slave-bin.000001 # Query # # use `test`; CREATE USER 'u18'@'localhost' IDENTIFIED WITH 'caching_sha2_password','u19'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' WITH MAX_QUERIES_PER_HOUR 2 MAX_USER_CONNECTIONS 2 slave-bin.000001 # Query # # use `test`; ALTER USER 'u18'@'localhost','u19'@'localhost','u20'@'localhost','u21'@'localhost','u22'@'localhost','u23'@'localhost' REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client' WITH MAX_QUERIES_PER_HOUR 2 MAX_USER_CONNECTIONS 2 PASSWORD EXPIRE NEVER slave-bin.000001 # Query # # use `test`; DROP USER tu1@localhost,tu2@localhost,u1@localhost, u2@localhost, u3@localhost, u4@localhost,u5@localhost,u6@localhost, u7@localhost, u8@localhost, u9@localhost,u10@localhost,u11@localhost,u12@localhost,u13@localhost, u14@localhost,u15@localhost,u16@localhost,u17@localhost,u18@localhost, u19@localhost,u20@localhost,u21@localhost,u22@localhost,u23@localhost slave-bin.000001 # Query # # use `test`; CREATE USER 'u1'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' slave-bin.000001 # Query # # use `test`; ALTER USER 'u1'@'localhost' PASSWORD EXPIRE slave-bin.000001 # Query # # use `test`; ALTER USER 'u1'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' slave-bin.000001 # Query # # use `test`; ALTER USER 'u1'@'localhost' PASSWORD EXPIRE slave-bin.000001 # Query # # use `test`; ALTER USER 'u1'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' slave-bin.000001 # Query # # use `test`; ALTER USER 'u1'@'localhost' PASSWORD EXPIRE slave-bin.000001 # Query # # use `test`; ALTER USER 'u1'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' slave-bin.000001 # Query # # use `test`; DROP USER u1@localhost slave-bin.000001 # Query # # use `test`; CREATE USER 'u1'@'localhost' IDENTIFIED WITH 'caching_sha2_password','u2'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' slave-bin.000001 # Query # # use `test`; GRANT ALL PRIVILEGES ON *.* TO 'u2'@'localhost' slave-bin.000001 # Query # # use `test`; ALTER USER 'u2'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' PASSWORD EXPIRE INTERVAL 45 DAY slave-bin.000001 # Query # # use `test`; DROP USER u1@localhost, u2@localhost slave-bin.000001 # Query # # use `test`; CREATE USER 'u1'@'localhost' IDENTIFIED WITH 'caching_sha2_password' slave-bin.000001 # Query # # use `test`; CREATE USER 'u2'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' slave-bin.000001 # Query # # use `test`; DROP USER u2@localhost slave-bin.000001 # Query # # use `test`; CREATE USER 'u2'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' REQUIRE NONE slave-bin.000001 # Query # # use `test`; CREATE USER 'u3'@'localhost' IDENTIFIED WITH 'mysql_native_password' slave-bin.000001 # Query # # use `test`; CREATE USER 'u4'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' slave-bin.000001 # Query # # use `test`; CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' slave-bin.000001 # Query # # use `test`; CREATE USER 'user2'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' slave-bin.000001 # Query # # use `test`; CREATE USER 'u5'@'localhost' IDENTIFIED WITH 'caching_sha2_password' REQUIRE SSL slave-bin.000001 # Query # # use `test`; CREATE USER 'u6'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' REQUIRE X509 slave-bin.000001 # Query # # use `test`; CREATE USER 'u7'@'localhost' IDENTIFIED WITH 'mysql_native_password' REQUIRE CIPHER 'cipher' slave-bin.000001 # Query # # use `test`; CREATE USER 'u8'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' REQUIRE ISSUER 'issuer' slave-bin.000001 # Query # # use `test`; CREATE USER 'u9'@'localhost' IDENTIFIED WITH 'caching_sha2_password' REQUIRE SUBJECT 'sub' slave-bin.000001 # Query # # use `test`; CREATE USER 'u10'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client' ISSUER '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA' CIPHER 'DHE-RSA-AES256-SHA' slave-bin.000001 # Query # # use `test`; CREATE USER 'u11'@'localhost' IDENTIFIED WITH 'caching_sha2_password' WITH MAX_QUERIES_PER_HOUR 2 slave-bin.000001 # Query # # use `test`; CREATE USER 'u12'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' WITH MAX_QUERIES_PER_HOUR 2 slave-bin.000001 # Query # # use `test`; CREATE USER 'u13'@'localhost' IDENTIFIED WITH 'mysql_native_password' WITH MAX_CONNECTIONS_PER_HOUR 2 slave-bin.000001 # Query # # use `test`; CREATE USER 'u14'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' WITH MAX_USER_CONNECTIONS 2 slave-bin.000001 # Query # # use `test`; CREATE USER 'u15'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client' ISSUER '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA' CIPHER 'cipher' WITH MAX_QUERIES_PER_HOUR 2 MAX_USER_CONNECTIONS 2 slave-bin.000001 # Query # # use `test`; DROP USER user1@localhost,u1@localhost,u2@localhost,u3@localhost,u4@localhost, u5@localhost,u6@localhost, u7@localhost, u8@localhost,u9@localhost, u10@localhost,u11@localhost,u12@localhost,u13@localhost,u14@localhost, u15@localhost slave-bin.000001 # Query # # use `test`; CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client' ISSUER '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA' WITH MAX_QUERIES_PER_HOUR 60 MAX_UPDATES_PER_HOUR 100 MAX_CONNECTIONS_PER_HOUR 1000 MAX_USER_CONNECTIONS 20 slave-bin.000001 # Query # # use `test`; GRANT SELECT ON *.* TO 'user1'@'localhost' slave-bin.000001 # Query # # use `test`; GRANT SELECT, INSERT, UPDATE ON `mysql`.* TO 'user1'@'localhost' slave-bin.000001 # Query # # use `test`; REVOKE INSERT,UPDATE ON mysql.* FROM user1@localhost slave-bin.000001 # Query # # use `test`; GRANT SELECT, INSERT, UPDATE ON *.* TO 'user2'@'localhost' slave-bin.000001 # Query # # use `test`; ALTER USER 'user2'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*4ACFE3202A5FF5CF467898FC58AAB1D615029441' REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client' ISSUER '/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA' WITH MAX_QUERIES_PER_HOUR 60 MAX_UPDATES_PER_HOUR 100 MAX_CONNECTIONS_PER_HOUR 1000 MAX_USER_CONNECTIONS 20 slave-bin.000001 # Query # # use `test`; CREATE USER 'user3'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' slave-bin.000001 # Query # # use `test`; DROP USER user1@localhost,user2@localhost,user3@localhost slave-bin.000001 # Query # # use `test`; CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' slave-bin.000001 # Query # # use `test`; CREATE USER 'user2'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*BB2A6C4B68EBE1B781C294D655785971401FB13B' slave-bin.000001 # Query # # use `test`; ALTER USER 'user1'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' slave-bin.000001 # Query # # use `test`; ALTER USER 'user2'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*F03819CC796CCA4052B8928179B81D18288B05A8' slave-bin.000001 # Query # # use `test`; CREATE USER 'user4'@'localhost' IDENTIFIED WITH 'caching_sha2_password' slave-bin.000001 # Query # # use `test`; ALTER USER 'user4'@'localhost' PASSWORD EXPIRE slave-bin.000001 # Query # # use `test`; ALTER USER 'user4'@'localhost' IDENTIFIED WITH 'caching_sha2_password' slave-bin.000001 # Query # # use `test`; CREATE USER 'user3'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' slave-bin.000001 # Query # # use `test`; CREATE USER 'user5'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*BB2A6C4B68EBE1B781C294D655785971401FB13B' slave-bin.000001 # Query # # use `test`; ALTER USER 'user3'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' slave-bin.000001 # Query # # use `test`; GRANT SELECT ON *.* TO 'user3'@'localhost' slave-bin.000001 # Query # # use `test`; ALTER USER 'user3'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' slave-bin.000001 # Query # # use `test`; ALTER USER 'user4'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' slave-bin.000001 # Query # # use `test`; ALTER USER 'user5'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*960F0A06F105B0FE8089E3F6FAD5369E8A28E241' slave-bin.000001 # Query # # use `test`; CREATE USER 'user6'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '' slave-bin.000001 # Query # # use `test`; ALTER USER 'user6'@'localhost' IDENTIFIED WITH 'mysql_native_password' slave-bin.000001 # Query # # use `test`; ALTER USER 'user6'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*9CAB2BAE176801E82ABA9E55CCCDDBF388E0301D' slave-bin.000001 # Query # # use `test`; DROP USER user1@localhost,user2@localhost,user3@localhost, user4@localhost,user5@localhost,user6@localhost include/rpl_end.inc End of 5.7 tests!