Skip to content

Commit 8299775

Browse files
committed
Make sure socket connections work correctly on Ubuntu.
1 parent 710c52c commit 8299775

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

.travis.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,14 @@ script:
4040
- "sudo ls -lah /var/log"
4141
- "sudo cat /var/log/mysql/error.log"
4242

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.
4451
- >
4552
mysql -u root -proot -h 127.0.0.1 -e 'show databases;'
4653
| grep -q 'performance_schema'

tasks/configure.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,12 @@
1010

1111
- name: Ensure MySQL is started and enabled on boot.
1212
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 }}"

0 commit comments

Comments
 (0)