can't create table errno: 13 permission denied mysql
snippet in sql

can't create table errno: 13 permission denied mysql

user5339

#1-fix permission
$ mysql -u root -p -e 'SHOW VARIABLES WHERE Variable_Name="datadir"'

#output
+---------------+-----------------------+
| Variable_name | Value                 |
+---------------+-----------------------+
| datadir       | /var/lib/mysql/ |
+---------------+-----------------------+
 
#2- Check owner of each file
$ ls -lh /var/lib/mysql/
 
#3- Update to correct owner
$ sudo chown -R db_admin:server_name /var/lib/mysql/*