mirror of
https://github.com/aljazceru/ansible-role-mysql.git
synced 2025-12-19 10:04:20 +01:00
Make sure socket connections work correctly on Ubuntu.
This commit is contained in:
@@ -40,7 +40,14 @@ script:
|
||||
- "sudo ls -lah /var/log"
|
||||
- "sudo cat /var/log/mysql/error.log"
|
||||
|
||||
# Check to make sure we can connect to MySQL.
|
||||
# Check to make sure we can connect to MySQL via Unix socket.
|
||||
- >
|
||||
mysql -u root -proot -e 'show databases;'
|
||||
| grep -q 'performance_schema'
|
||||
&& (echo 'MySQL running normally' && exit 0)
|
||||
|| (echo 'MySQL not running' && exit 1)
|
||||
|
||||
# Check to make sure we can connect to MySQL via TCP.
|
||||
- >
|
||||
mysql -u root -proot -h 127.0.0.1 -e 'show databases;'
|
||||
| grep -q 'performance_schema'
|
||||
|
||||
@@ -10,3 +10,12 @@
|
||||
|
||||
- name: Ensure MySQL is started and enabled on boot.
|
||||
service: "name={{ mysql_daemon }} state=started enabled={{ mysql_enabled_on_startup }}"
|
||||
|
||||
- name: Ensure MySQL socket file has correct permissions.
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
mode: 0755
|
||||
notify: restart mysql
|
||||
with_items:
|
||||
- "{{ mysql_datadir }}"
|
||||
- "{{ mysql_socket }}"
|
||||
|
||||
Reference in New Issue
Block a user