1

My problem is short. I have typed

chown -R root:root /var

and my mysql server stopped working :/ I tried searching for the solution, but nothing helped me.

I have also problem with permissions in Phpmyadmin. Errors you can found here.

I know, that i have ruined the whole structure of ownerhsip, so if you have a list of default users and groups in var I would be very gratefull.

2

That command was harmful. It changed the ownership of all objects (file and directories) inside /var directory to root user. But that is not what some programs expect, including mysql

mysql wants the files inside /var/lib/mysql directory to be owned by the user mysql.

So, you should change the ownership of the directory (recursively) again using this command

sudo chown -R mysql:mysql /var/lib/mysql

Except this file /var/lib/mysql/debian-5.7.flag. That one is owned by root. After executing the above command, you can again change the ownership of this file

sudo chown root:root /var/lib/mysql/debian-5.7.flag

Also mysql wants the its log directory to be owned by mysql user. So, do this again to change ownership of that too

sudo chown -R mysql:mysql /var/log/mysql

Fortuantely, I had phpmyadmin installed. I can give the files list owned by mysql in /var/lib/phpmyadmin directory. Here is the list. Change ownership of all of these using sudo chown mysql:mysql filename command.

/var/lib/mysql/phpmyadmin 
/var/lib/mysql/phpmyadmin/pma__table_uiprefs.ibd 
/var/lib/mysql/phpmyadmin/pma__bookmark.frm 
/var/lib/mysql/phpmyadmin/pma__pdf_pages.ibd 
/var/lib/mysql/phpmyadmin/pma__usergroups.ibd 
/var/lib/mysql/phpmyadmin/pma__savedsearches.ibd 
/var/lib/mysql/phpmyadmin/pma__designer_settings.ibd 
/var/lib/mysql/phpmyadmin/pma__relation.ibd 
/var/lib/mysql/phpmyadmin/pma__export_templates.ibd 
/var/lib/mysql/phpmyadmin/pma__favorite.frm 
/var/lib/mysql/phpmyadmin/pma__column_info.ibd 
/var/lib/mysql/phpmyadmin/pma__userconfig.ibd 
/var/lib/mysql/phpmyadmin/pma__users.frm 
/var/lib/mysql/phpmyadmin/pma__relation.frm 
/var/lib/mysql/phpmyadmin/pma__table_coords.frm 
/var/lib/mysql/phpmyadmin/pma__navigationhiding.frm 
/var/lib/mysql/phpmyadmin/pma__column_info.frm 
/var/lib/mysql/phpmyadmin/pma__history.frm 
/var/lib/mysql/phpmyadmin/pma__userconfig.frm 
/var/lib/mysql/phpmyadmin/pma__tracking.frm 
/var/lib/mysql/phpmyadmin/pma__export_templates.frm 
/var/lib/mysql/phpmyadmin/pma__users.ibd 
/var/lib/mysql/phpmyadmin/pma__table_coords.ibd 
/var/lib/mysql/phpmyadmin/pma__table_info.ibd 
/var/lib/mysql/phpmyadmin/pma__table_info.frm 
/var/lib/mysql/phpmyadmin/pma__savedsearches.frm 
/var/lib/mysql/phpmyadmin/pma__central_columns.frm 
/var/lib/mysql/phpmyadmin/pma__central_columns.ibd 
/var/lib/mysql/phpmyadmin/pma__history.ibd 
/var/lib/mysql/phpmyadmin/pma__favorite.ibd 
/var/lib/mysql/phpmyadmin/pma__table_uiprefs.frm 
/var/lib/mysql/phpmyadmin/pma__recent.ibd 
/var/lib/mysql/phpmyadmin/pma__usergroups.frm 
/var/lib/mysql/phpmyadmin/pma__navigationhiding.ibd 
/var/lib/mysql/phpmyadmin/pma__bookmark.ibd 
/var/lib/mysql/phpmyadmin/pma__designer_settings.frm 
/var/lib/mysql/phpmyadmin/pma__tracking.ibd 
/var/lib/mysql/phpmyadmin/pma__pdf_pages.frm 
/var/lib/mysql/phpmyadmin/pma__recent.frm 
/var/lib/mysql/phpmyadmin/db.opt 

I've answered this to fix only mysql related stuff. But if you need to fix all those, you can check these questions

  • @Rinzwind why? where am i doing wrong? – Anwar Oct 27 '16 at 12:19
  • That's working :D But I have one problem more with phpmyadmin "Permission denied" in /var/lib/php/sessions :/ Full error: prntscr.com/czlgo2 – Kryniowesegryderiusz Oct 27 '16 at 12:23
  • @Rinzwind I'm fixing the stuff only in /var/lib/mysql – Anwar Oct 27 '16 at 12:25
  • Is there any list of users and groups in var that now i have to set up? – Kryniowesegryderiusz Oct 27 '16 at 12:27
  • @Kryniowesegryderiusz are you looking for answers for all files and dirs inside /var/ or only mysql? I provided answer only for mysql – Anwar Oct 27 '16 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.