File tree 3 files changed +8
-1
lines changed
lib/puppet/provider/mysql_user
3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,8 @@ mysql::db { 'mydb':
170
170
}
171
171
```
172
172
173
+ If required, the password can also be an empty string to allow connections without an password.
174
+
173
175
### Install Percona server on CentOS
174
176
175
177
This example shows how to do a minimal installation of a Percona server on a
Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ def password_hash=(string)
126
126
# default ... if mysqld_version does not work
127
127
self . class . mysql_caller ( "SET PASSWORD FOR #{ merged_name } = '#{ string } '" , 'system' )
128
128
elsif newer_than ( 'mysql' => '5.7.6' , 'percona' => '5.7.6' )
129
- raise ArgumentError , _ ( 'Only mysql_native_password (*ABCD...XXX) hashes are supported.' ) unless string =~ %r{^\* }
129
+ raise ArgumentError , _ ( 'Only mysql_native_password (*ABCD...XXX) hashes are supported.' ) unless string =~ %r{^\* |^$ }
130
130
self . class . mysql_caller ( "ALTER USER #{ merged_name } IDENTIFIED WITH mysql_native_password AS '#{ string } '" , 'system' )
131
131
else
132
132
self . class . mysql_caller ( "SET PASSWORD FOR #{ merged_name } = '#{ string } '" , 'system' )
Original file line number Diff line number Diff line change 43
43
user [ :password_hash ] = 'foo'
44
44
expect ( user [ :password_hash ] ) . to eq ( 'foo' )
45
45
end
46
+
47
+ it 'accepts an empty password' do
48
+ user [ :password_hash ] = ''
49
+ expect ( user [ :password_hash ] ) . to eq ( '' )
50
+ end
46
51
end
47
52
48
53
context 'using foo@LocalHost' do
You can’t perform that action at this time.
0 commit comments