install bd
This commit is contained in:
		@@ -7,7 +7,19 @@
 | 
			
		||||
    state: present
 | 
			
		||||
 | 
			
		||||
- name: Create mysql database
 | 
			
		||||
  mysql_db: name={{ maria_dbname }} state=present
 | 
			
		||||
  mysql_db: 
 | 
			
		||||
    name: "{{ maria_dbname }}" 
 | 
			
		||||
    state: present
 | 
			
		||||
    login_unix_socket: /var/run/mysqld_mysqld.sock
 | 
			
		||||
 | 
			
		||||
- name: Creation de l'utilisateur mysql avec tous les privileges
 | 
			
		||||
  mysql_user:
 | 
			
		||||
    name: "{{ maria_dbuser }}"
 | 
			
		||||
    password: "{{ maria_dbpasswd }}"
 | 
			
		||||
    priv: "*.*:ALL,GRANT"
 | 
			
		||||
    login_unix_socket: /var/run/mysqld/mysqld.sock
 | 
			
		||||
  with_items:
 | 
			
		||||
    - 127.0.0.1
 | 
			
		||||
 | 
			
		||||
- name: Copie du fichier my.cnf pour autorises toutes les adresses sur le port 3306
 | 
			
		||||
  copy : src=my.cnf dest=/etc/mysql/
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@ apt-get update && apt-get upgrade -y
 | 
			
		||||
# Install MySQL Server in a Non-Interactive mode. Default root password will be "root"
 | 
			
		||||
echo "mysql-server mysql-server/root_password password root" | debconf-set-selections
 | 
			
		||||
echo "mysql-server mysql-server/root_password_again password root" | debconf-set-selections
 | 
			
		||||
apt-get -y install mysql-server
 | 
			
		||||
apt-get -y install mariadb-server
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Run the MySQL Secure Installation wizard
 | 
			
		||||
@@ -13,4 +13,4 @@ mysql_secure_installation
 | 
			
		||||
sed -i 's/127\.0\.0\.1/0\.0\.0\.0/g' /etc/mysql/my.cnf
 | 
			
		||||
mysql -uroot -p -e 'USE mysql; UPDATE `user` SET `Host`="%" WHERE `User`="root" AND `Host`="localhost"; DELETE FROM `user` WHERE `Host` != "%" AND `User`="root"; FLUSH PRIVILEGES;'
 | 
			
		||||
 | 
			
		||||
service mysql restart
 | 
			
		||||
service mysql restart
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								s-lb-bd.retry
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								s-lb-bd.retry
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
localhost
 | 
			
		||||
		Reference in New Issue
	
	Block a user