I am trying to use the mysql_db module for the database creation in a following way:
- name: Create Application Database
mysql_db: name={{ dbname }} state=present login_host={{ db_server }} login_password={{ admin_password }} login_user={{ admin_user }}
and also
- name: Create Application Database v2
mysql_db: name={{ dbname }} state=present login_host={{ db_server }}
My database is running on the port != 3306, so need to specify it somewhere.
I have put it into ~/.my.cnf and also into /etc/my.cnf, but the module mysql_db does not take it into account.
~/.my.cnf == /etc/my.cnf
[client]
port=5501
user=admin
password=ABRACADABRA
When using the command-line : mysql -h db-host-here I am connecting seamlessly
I am using RH Linux v6.4
The connection uisng python from the same host
import MySQLdb
db = MySQLdb.connect(host="…, port=5501)
works without any troubles
Thank you for your comments.