Configuring Password-Free Authentication for MySQL
username indicates the specified user name, % indicates that the password-free setting applies to multiple nodes, and *.* indicates that full permissions on all databases are assigned to the specified user.
- If no users exist, create a password-free user.
1 2
mysql> CREATE USER 'username'@'%' IDENTIFIED BY ''; mysql> flush privileges;
- If a user has been created, set it to a password-free user.
1 2
mysql> ALTER USER 'username'@'%' IDENTIFIED BY ''; mysql> flush privileges;
- Create a database and grant all permissions to the user.
1 2 3 4
mysql> CREATE DATABASE test; mysql> flush privileges; mysql> GRANT ALL PRIVILEGES ON *.* TO 'username'@'%'; mysql> flush privileges;
Parent topic: Common Operations