We help IT Professionals succeed at work.

PHPMyAdmin help - running on http://localhost:81

gian_the_man
gian_the_man asked
on
70,045 Views
Last Modified: 2008-03-06
Hello,

I installed apache, mysql and php on my Windows XP pro box for developmental purposes. I can start Apache and view the page at http://localhost:81. I selected 81 to prevent conflicts in IIS but I may be wrong about that....

Anyway,
http://localhost:81/index.php will pull up all the phpinfo () data and a test_mysql.php page successfully creates a table in mysql.

The problem I'm having seems to be with phpmyadmin only. Though I may be wrong... At the moment,
http://localhost:81/phpmyadmin pulls up the main page, but clicking on any of the links leads to a 404 page cannot be displayed error. I think it has something to do with the ":81"

I read this in the docs:
$cfg['Servers'][$i]['port'] string
The port-number of your $i-th MySQL-server. Default is 3306 (leave blank). If you use "localhost" as the hostname, MySQL ignores this port number and connects with the socket, so if you want to connect to a port different from the default port, use "127.0.0.1" or the real hostname in $cfg['Servers'][$i]['host'].

But I'm not sure if that's something I should modify. Any help appreciated. I will send any information you need.

Here is some additional info from phpinfo ()

_SERVER["SERVER_SIGNATURE"] <address>Apache/2.0.49 (Win32) Server at localhost Port 81</address>  
_SERVER["SERVER_SOFTWARE"] Apache/2.0.49 (Win32)
_SERVER["SERVER_NAME"] localhost
_SERVER["SERVER_ADDR"] 127.0.0.1
_SERVER["SERVER_PORT"] 81
_SERVER["REMOTE_ADDR"] 127.0.0.1
_SERVER["DOCUMENT_ROOT"] C:/web
_SERVER["SERVER_ADMIN"] gian.gonz@xxxx.net
_SERVER["SCRIPT_FILENAME"] C:/php/php.exe
_SERVER["REMOTE_PORT"] 4710
_SERVER["REDIRECT_URL"] /test.php
_SERVER["GATEWAY_INTERFACE"] CGI/1.1
_SERVER["SERVER_PROTOCOL"] HTTP/1.1
_SERVER["REQUEST_METHOD"] GET
_SERVER["QUERY_STRING"] no value
_SERVER["REQUEST_URI"] /test.php
_SERVER["SCRIPT_NAME"] /php/php.exe
_SERVER["PATH_INFO"] /test.php
_SERVER["PATH_TRANSLATED"] C:\web\test.php
_SERVER["PHP_SELF"] /test.php

Comment
Watch Question

So what happens when you log into:

http://127.0.0.1:81/phpmyadmin

and click on a link?
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
That worked, psadac. Thanks a bunch...

In regards to the user and password prompt, do I have to specify a domain? I couldn't access with what I tried...

Thanks,

Gian

Commented:
Gian, it's a mysql user, not an NT User. By default each mysql installation has a user named root with no password, and that's the user you should have used. for security reasons you should change this password.

Author

Commented:
I changed the 'root' password when setting up mysql. I still can't get in using http authentication with user- root password - xxx
#This File was made using the WinMySQLAdmin 1.4 Tool
#5/3/2004 11:53:00 PM

#Uncomment or Add only the keys that you know how works.
#Read the MySQL Manual for instructions

[mysqld]
basedir=C:/mysql
#bind-address=192.168.5.101
datadir=C:/mysql/data
#language=C:/mysql/share/your language directory
#slow query log#=
#tmpdir#=
#port=3306
#set-variable=key_buffer=16M
[WinMySQLadmin]
Server=C:/mysql/bin/mysqld-nt.exe
user=root
password=v6gt6y

If I switch to the 'config' auth type, I can get in. I'd like to know why I can't access with http....

Thanks,

Gian

Author

Commented:
I see what's going on....

There are two places for the auth_type configuration....

$cfg['Servers'][$i]['auth_type']     = 'config';    // Authentication method (config, http or cookie

based)?
$cfg['Servers'][$i]['user']          = 'root';      // MySQL user
$cfg['Servers'][$i]['password']      = 'xxxxxxx';          // MySQL password (only needed
                                                    // with 'config' auth_type)

And this one....

$cfg['Servers'][$i]['controlpass']     = '';
$cfg['Servers'][$i]['auth_type']       = 'config';
$cfg['Servers'][$i]['user']            = 'root';
$cfg['Servers'][$i]['password']        = '';

I was changing the top one to http.... it was the other one, right? or is it both?

Commented:
no, you can configure several mysql servers with phpmyadmin, that's why you have many $cfg['Servers'][i][...] and between these servers configurations you have an instruction $i++;
basically, if you choose :

  $cfg['Servers'][$i]['auth_type'] = 'config';

phpmyadmin will use :

$cfg['Servers'][$i]['user']            = 'root';
$cfg['Servers'][$i]['password']        = ''

as mysql user and password to authenticate to mysql. in your situation it will work since you have not changed mysql default password.
however if you choose :

  $cfg['Servers'][$i]['auth_type'] = 'http';

you will be asked a mysql user and password, and the user and password in your config.inc.php will not be used.
i prefer this solution for the following reasons :
- your password is not stored in a config file;
- you can have multiple login accounts
- you can set different privileges for each user
- anybody having access to your web page will not have root privileges on your database.

is it clearer ?
could anyone tell me as a side ques how to make privallages for certain users in phpmyadmin?
thanks

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.