Skip to content

REQUIRE

CREATE USER 'user1'@'localhost' IDENTIFIED BY 'password';
ALTER USER 'user1'@'localhost' REQUIRE SSL;
Query OK, 0 rows affected (0.04 sec)

In the provided example, a new user ‘user1’ is created. Next, the REQUIRE SSL clause is used to ensure that the user can only connect to the MySQL server through an encrypted channel. The server returns Query OK indicating that the operations were successful.