forked from ungleich-public/cdist
		
	fixed the generating of .my.cnf
This commit is contained in:
		
					parent
					
						
							
								dc5fb8b769
							
						
					
				
			
			
				commit
				
					
						3ceb643487
					
				
			
		
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -19,13 +19,18 @@
 | 
			
		|||
#
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
# store the root password in /root/.my.cnf so that processes can connect
 | 
			
		||||
# to the database without requiring a passwort input
 | 
			
		||||
rootpassword="$(cat "$__object/parameter/password")"
 | 
			
		||||
 | 
			
		||||
# set root password
 | 
			
		||||
mysqladmin -u root password $rootpassword
 | 
			
		||||
 | 
			
		||||
# store the root password in /root/.my.cnf so that processes can connect
 | 
			
		||||
cat <<-EOF > /root/.my.cnf
 | 
			
		||||
	[client]
 | 
			
		||||
	password=$rootpassword
 | 
			
		||||
EOF
 | 
			
		||||
 | 
			
		||||
# remove anonymous users
 | 
			
		||||
mysql -u root -p <<-EOF
 | 
			
		||||
	DELETE FROM mysql.user WHERE User='';
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue