简体   繁体   English

无意中以root用户身份安装了phpmyadmin

[英]Accidentally installed phpmyadmin as root user

While trying to install phpmyadmin, I accidentally installed it as a root user. 在尝试安装phpmyadmin时,我不小心将其安装为root用户。

Beginning of the story, I was editing the httpd.conf file of Apache. 故事的开头,我正在编辑Apache的httpd.conf文件。 To avoid permission issues while running some commands, i did sudo su - on the terminal. 为了避免在运行某些命令时出现权限问题,我在终端上做了sudo su - Thereafter without exiting from root user, I installed phpmyadmin using the following commands 此后,在没有退出root用户的情况下,我使用以下命令安装了phpmyadmin

cd /Library/WebServer/Documents/
tar -xvf ~/Downloads/phpMyAdmin-3.5.2.2-english.tar.gz
mv phpMyAdmin-3.5.2.2-english/ phpmyadmin
cd phpmyadmin
mv config.sample.inc.php config.inc.php

But now when I try to install yii at /Library/WebServer/Documents/ , i get the following error 但是现在当我尝试在/Library/WebServer/Documents/上安装yii时,我收到以下错误

PHP Warning – yii\base\ErrorException

mkdir(): Permission denied

Is there any way I can remove the root user privilege from phpmyadmin without uninstalling? 有没有什么办法可以在不卸载的情况下从phpmyadmin中删除root用户权限?

Operating system: OS MAC Mavericks 操作系统:OS MAC Mavericks

chown with the -R flag (recursive) is probably what you want. 带-R标志 (递归)的chown可能就是你想要的。 (The following may not apply exactly to your circumstances so please consider it carefully before running). (以下内容可能不完全适用于您的情况,因此请在运行前仔细考虑)。

Of course, replace {YourUsername} with your actual username. 当然,将{YourUsername}替换为您的实际用户名。 The commands below just change the owner of the files and not the group. 以下命令只是更改文件的所有者而不是组。 If you need to change the group name also, the new name goes after the colon: 如果您还需要更改组名,则新名称将在冒号后面:

cd /Library/WebServer/Documents/
chown -R {YourUsername}: phpmyadmin

I got the solution to this problem, just simple... All works with rights on folders in Yii. 我得到了这个问题的解决方案,只是简单...所有工作都与Yii文件夹的权利。

Applied the chmod command recursively across yii/ directory. 在yii /目录中递归地应用chmod命令。 The following is the command snippet for reference: 以下是用于参考的命令片段:

Editors-Mac:Documents cborkotoky$ chmod -R 777 yii
Editors-Mac:Documents cborkotoky$ pwd
/Library/WebServer/Documents
Editors-Mac:Documents cborkotoky$ ls -l
total 80

-rw-r--r--    1 cborkotoky  wheel   3726 Dec 11  2013 PoweredByMacOSX.gif
-rw-r--r--    1 cborkotoky  wheel  31958 Dec 11  2013 PoweredByMacOSXLarge.gif
drwxr-xr-x    5 cborkotoky  wheel    170 Feb 28 23:18 firstProject
-rw-r--r--    1 cborkotoky  wheel     44 Jun 28  2014 index.html.en
drwxrwxrwx@ 112 cborkotoky  wheel   3808 Feb 28 14:03 phpmyadmin
-rw-r--r--    1 cborkotoky  wheel     23 Feb 26 17:59 test.php
drwxrwxrwx    4 cborkotoky  wheel    136 Mar  1 02:03 yii

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM