phpmyadmin error 13 permission denied

12,067

Seems that the web server cannot read some (or all) files in the phpmyadmin directory ((Errcode: 13 - Permission denied)).

You need to fix the permissions by executing the following commands, assuming the phpmyadmin is located at /path/to/phpmyadmin:

find /path/to/phpmyadmin -type d -exec chmod 755 {} \;
find /path/to/phpmyadmin -type f -exec chmod 644 {} \; 

Obviously, you need to replace /path/to/phpmyadmin with the actual path.

Share:
12,067
bezoadam
Author by

bezoadam

Updated on June 04, 2022

Comments

  • bezoadam
    bezoadam almost 2 years

    I was working with my php server & phpmyadmin for MYSQL. I wanted to install some packages with composer, than somehow I changed permissions on my project folder and than database from phpmyadmin disappeared. I lost everything. I am trying to recover it for 3 hours. I am receiving these errors when I am trying to import create_tables.sql

    #13 - Can't get stat of './phpmyadmin' (Errcode: 13 - Permission denied)
    

    and

    Warning in ./libraries/dbi/DBIMysqli.php#261
     mysqli_query(): (HY000/1018): Can't read '.' (error code: 13 - Permission denied)
    

    I am running on Web server: Apache/2.4.23 (Unix) PHP/5.6.25 libmysql - mysqlnd 5.0.11-dev

    Database server: 5.7.16 - MySQL Community Server (GPL)

    English errors

    Does someone know how to fix this?

  • bezoadam
    bezoadam over 7 years
    Thank you for answer, but It didn't work. I am still not able to create database (permission error)
  • jsalatas
    jsalatas over 7 years
    Can you please post the exact error (in english) you are getting now?
  • bezoadam
    bezoadam over 7 years
    still same error "Not enough privilege to view server status." "#13 - Can't get stat of './mydb' (Errcode: 13 - Permission denied)" and I am running .sql code starting with CREATE DATABASE IF NOT EXISTS mydb DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; USE mydb;
  • jsalatas
    jsalatas over 7 years
    OK. This is something different to what you described before. It means that the user you are connecting to phpmyadmin, doesn't have the privilege to view existing databases or/and create new databases in mysql server. If the user has the privileges, check the permissions in /var/lib/mysql and make sure everything under this directory is owned by user mysql, group mysql and that the mysql user has full access to all files under that directory.
  • Isaac Bennetch
    Isaac Bennetch over 7 years
    Yeah, I second the thought about permissions trouble with the database data directory. This looks like a broken MySQL installation (possibly combined with a broken phpMyAdmin install for the same reasons, but the parent answer would have fixed that).