mirror of
				https://github.com/community-scripts/ProxmoxVE.git
				synced 2025-11-04 10:22:50 +00:00 
			
		
		
		
	optimize mariadb check
This commit is contained in:
		@@ -30,7 +30,7 @@ msg_info "Setting up database"
 | 
			
		||||
DB_NAME=firefly
 | 
			
		||||
DB_USER=firefly
 | 
			
		||||
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
 | 
			
		||||
MYSQL_VERSION=$(mysql --version | grep -oP 'Distrib \K[0-9]+\.[0-9]+\.[0-9]+')
 | 
			
		||||
MYSQL_VERSION=$(mariadb --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -n1)
 | 
			
		||||
mysql -u root -e "CREATE DATABASE $DB_NAME;"
 | 
			
		||||
mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
 | 
			
		||||
mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user