File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,14 @@ script:
40
40
- " sudo ls -lah /var/log"
41
41
- " sudo cat /var/log/mysql/error.log"
42
42
43
- # Check to make sure we can connect to MySQL.
43
+ # Check to make sure we can connect to MySQL via Unix socket.
44
+ - >
45
+ mysql -u root -proot -e 'show databases;'
46
+ | grep -q 'performance_schema'
47
+ && (echo 'MySQL running normally' && exit 0)
48
+ || (echo 'MySQL not running' && exit 1)
49
+
50
+ # Check to make sure we can connect to MySQL via TCP.
44
51
- >
45
52
mysql -u root -proot -h 127.0.0.1 -e 'show databases;'
46
53
| grep -q 'performance_schema'
Original file line number Diff line number Diff line change 10
10
11
11
- name : Ensure MySQL is started and enabled on boot.
12
12
service : " name={{ mysql_daemon }} state=started enabled={{ mysql_enabled_on_startup }}"
13
+
14
+ - name : Ensure MySQL socket file has correct permissions.
15
+ file :
16
+ path : " {{ item }}"
17
+ mode : 0755
18
+ notify : restart mysql
19
+ with_items :
20
+ - " {{ mysql_datadir }}"
21
+ - " {{ mysql_socket }}"
You can’t perform that action at this time.
0 commit comments