Rate This Document
Findability
Accuracy
Completeness
Readability

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.

  1. If no users exist, create a password-free user.
    1
    2
    mysql> CREATE USER 'username'@'%' IDENTIFIED BY '';
    mysql> flush privileges;
    
  2. If a user has been created, set it to a password-free user.
    1
    2
    mysql> ALTER USER 'username'@'%' IDENTIFIED BY '';
    mysql> flush privileges;
    
  3. 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;