how connect to phpmyadmin from other hosts

杀马特。学长 韩版系。学妹 提交于 2019-12-10 14:58:47

问题


I have a lan network with 2 computer and installed wamp on computer 1.

now I want to access to whole of phpmyadmin on computer 1 from computer 2 and make changes.

from users tab in root of phpmyadmin page I created a user. I filled username field with 'root' and host field with my computer 2 IP address and left password field with "no password" and checked all Global privileges for my user.

now I connect to wamp on computer 1 from computer 2 and click on phpmyadmin link. but It give me this error:

FORBIDDEN

you don't have permission to access /phpmyadmin/ on this server

what I must do now for solving this problem?


回答1:


That error message has more to do with Apache blocking access, than with phpMyAdmin, or the MySQL user account created.

Your issue is with Apache's configuration, or more specifically your WAMP's configuration of the /phpmyadmin URL.

Find the configuration file where the \phpmyadmin URL Alias is set up. It possibly will have these lines in it -

<Location /phpmyadmin>
  order deny,allow
  deny from all
  allow from 127.0.0.1
</Location>

Add another allow from IP.Address line in it to match the IP.Address of your other LAN system. Restart Apache.

If phpMyAdmin is not set up via an Alias (it is under WampDeveloper, not sure about other WAMPs like Xampp or WampServer), but is rather just a dump of its files in a DocumentRoot (website's webroot) sub-folder, check the .htaccess file there.

I filled username field with 'root' and host field with my computer 2 IP address and left password field with "no password" and checked all Global privileges for my user.

In this case, the host field will always be in relation to the location of MySQL, not to the system phpMyAdmin is being accessed from... If you are accessing MySQL via phpMyAdmin, the host field should always be - localhost. As phpMyAdmin is on the same system MySQL is. The only time you'd use another domain-name, host-name, or IP for host: is when you are accessing MySQL directly from another system. By directly I mean, not via a script or URL, but via some type of a client (which is almost always a binary/executable).




回答2:


change below line in C:\xampp\apache\conf\extra\httpd-xampp.conf, you can directly open this file by

<Directory "C:/xampp/phpMyAdmin">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Require all granted
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>



回答3:


go to PHPMYADMIN.conf or search on it from wamp or wamp64

adjust on it as the following:

change

Require local

to be

Require all granted

And add your another client IP address after this line

Allow from localhost ::1 127.0.0.1

add this

Allow from CLIENTIPADDRESS

Restart Wamp or Wamp64




回答4:


go to C:\wamp\alias\phpmyAdmin.conf open phpmyadmin.conf in notepad overwrite the below given code in it

<Directory "c:/wamp/apps/phpmyadmin3.3.9/"> Options Indexes FollowSymLinks MultiViews AllowOverride all Order Allow,Deny Allow from all </Directory>

change here is allow from all only..




回答5:


First just check you have installed php, mysql and apache correctly. Now if are you able to access phpmyadmin from your local host then above things are installed correctly. If you want to access phpmyadmin from another host, make the entry of 2nd host in following config file /etc/httpd/config.d/phpmyadmin.conf

<Location /phpmyadmin>  
order deny,allow  
deny from all   
allow from 127.0.0.1 <2nd host IP address>
</Location>

Then save you httpd settings and stop

service httpd restart

And now you are able to access phpmyadmin from another host



来源:https://stackoverflow.com/questions/16813138/how-connect-to-phpmyadmin-from-other-hosts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!