# error message when trying to create mariadb databse

**URL:** <https://forum.ansible.com/t/error-message-when-trying-to-create-mariadb-databse/17449>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [February 4, 2015, 9:04pm UTC](https://forum.ansible.com/t/error-message-when-trying-to-create-mariadb-databse/17449 "2015-02-04T21:04:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eff\_Ggl](https://avatars.discourse-cdn.com/v4/letter/e/0ea827/32.png) [@Eff\_Ggl](https://forum.ansible.com/u/Eff_Ggl)\
**Post date:** [February 4, 2015, 9:04pm UTC](https://forum.ansible.com/t/error-message-when-trying-to-create-mariadb-databse/17449/1 "2015-02-04T21:04:10Z")

</div>

I am trying to install mysql using ANSIBLE on CentOS7(i have no idea why every documention in the world now ONLY talks ablotu Ubuntu and NO CentOS anymore…really SAD!)

here is my create\_db.yml file

---

<div class="post-metadata">

**Author:** ![Giovanni\_Tirloni](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Giovanni\_Tirloni](https://forum.ansible.com/u/Giovanni_Tirloni)\
**Post date:** [February 5, 2015, 10:47am UTC](https://forum.ansible.com/t/error-message-when-trying-to-create-mariadb-databse/17449/2 "2015-02-05T10:47:33Z")

</div>

Have you installed MySQL before and changed the password? If so, specify  
the user/password with privileges to create databases.

- name: Install Python MySQLdb  
&nbsp;&nbsp;yum:  
&nbsp;&nbsp;&nbsp;&nbsp;name: MySQL-python  
&nbsp;&nbsp;&nbsp;&nbsp;state: latest

- name: Create the Drupal database  
&nbsp;&nbsp;mysql\_db:  
&nbsp;&nbsp;&nbsp;&nbsp;name: db\_name  
&nbsp;&nbsp;&nbsp;&nbsp;login\_user: XXX  
&nbsp;&nbsp;&nbsp;&nbsp;login\_password: XXX  
&nbsp;&nbsp;&nbsp;&nbsp;state: present  
&nbsp;&nbsp;  
- name: Create the Drupal user  
&nbsp;&nbsp;mysql\_user:  
&nbsp;&nbsp;&nbsp;&nbsp;name: db\_user  
&nbsp;&nbsp;&nbsp;&nbsp;password: db\_password  
&nbsp;&nbsp;&nbsp;&nbsp;priv: "{{ db\_name }}.\*:ALL"  
&nbsp;&nbsp;&nbsp;&nbsp;host: localhost

You can simplify your setup.yml playbook too:

- name: Install packages  
&nbsp;&nbsp;yum:  
&nbsp;&nbsp;&nbsp;&nbsp;name: "{{ item }}"  
&nbsp;&nbsp;&nbsp;&nbsp;state: latest  
&nbsp;&nbsp;with\_items:  
&nbsp;&nbsp;&nbsp;&nbsp;- mariadb-server  
&nbsp;&nbsp;&nbsp;&nbsp;- php-gd  
&nbsp;&nbsp;&nbsp;&nbsp;- php-ldap  
&nbsp;&nbsp;&nbsp;&nbsp;- php-odbc  
&nbsp;&nbsp;&nbsp;&nbsp;- php-pear  
&nbsp;&nbsp;&nbsp;&nbsp;- php-xml  
&nbsp;&nbsp;&nbsp;&nbsp;- php-xmlrpc  
&nbsp;&nbsp;&nbsp;&nbsp;- php-mbstring  
&nbsp;&nbsp;&nbsp;&nbsp;- php-snmp  
&nbsp;&nbsp;&nbsp;&nbsp;- php-soap  
&nbsp;&nbsp;&nbsp;&nbsp;- curl  
&nbsp;&nbsp;&nbsp;&nbsp;- curl-devel  
&nbsp;&nbsp;&nbsp;&nbsp;- php-mysql

Giovanni
