1#1-fix permission
2$ mysql -u root -p -e 'SHOW VARIABLES WHERE Variable_Name="datadir"'
3
4#output
5+---------------+-----------------------+
6| Variable_name | Value |
7+---------------+-----------------------+
8| datadir | /var/lib/mysql/ |
9+---------------+-----------------------+
10
11#2- Check owner of each file
12$ ls -lh /var/lib/mysql/
13
14#3- Update to correct owner
15$ sudo chown -R db_admin:server_name /var/lib/mysql/*
16