Need help installing phpMyAdmin 2.8.2

They have: 68 posts

Joined: Jun 2006

Hey,

I'm setting up a server... and installed Apache 2.2, PHP5 and mySQL 5.0. I know the Apache and PHP parts i got right... by the mySQL portion is where i'm running into trouble.

I tried to install phpMyAdmin 2.8.2.. but i can't seem to connect to mySQL when i get to the step where i run http://localhost/phpMyAdmin-2.8.2/index.php

The error reads as follows:

Quote: phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server.
Error

MySQL said: Documentation
#1045 - Access denied for user 'root'@'localhost' (using password: NO)

It also displays a large amount of php code above that message. I tried to configure config.inc.php .. but obviously did it wrong.

I was editing this portion of the code:

show_config_form(array(
            array('Server hostname', '----', 'Hostname where MySQL server is running'),
            array('Server port', '3306', 'Port on which MySQL server is listening, leave empty if don\'t know'),
            array('Server socket', 'socket', 'Socket on which MySQL server is listening, leave empty if don\'t know'),
            array('Connection type', 'tcp', 'How to connect to server, keep tcp if don\'t know', array('tcp', 'socket')),
            array('PHP extension to use', 'mysql', 'What PHP extension to use, use mysqli if supported', array('mysql', 'mysqli')),
            array('Compress connection', 'compress', 'Whether to compress connection to MySQL server', FALSE),
            array('Authentication type', 'config', 'Authentication method to use', array('cookie', 'http', 'config')),
            array('User for config auth', 'root', 'Leave empty if not using config auth'),
            array('Password for config auth', '----', 'Leave empty if not using config auth', 'rosebud'),
            array('Only database to show', 'only_db', 'Limit listing of databases in left frame to this one'),
            array('Verbose name of this server', 'verbose', 'Name to display in server selection'),
            array('phpMyAdmin control user', 'controluser', 'User which phpMyAdmin can use for various actions'),
            array('phpMyAdmin control user password', 'controlpass', 'Password for user which phpMyAdmin can use for various actions', 'password'),
            array('phpMyAdmin database for advanced features', 'pmadb', 'phpMyAdmin will allow much more when you enable this. Table names are filled in automatically.'),
            ),
            'Configure server',
            ($number === FALSE) ? 'Enter new server connection parameters.' : 'Editing server ' . get_server_name($defaults, $number),
            $defaults, $number === FALSE ? 'Add' : '', 'Servers_');
'

(the dashed lines were filled in with my server info/user info

Does anyone have any ideas of what i'm doing wrong?

I'm fairly positive mySQL is fine.. because i was able to create a database in there and all that... i just haven't had any success connecting to it (i also tried to install a php search called Sphider).

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

I can't reproduce the error with a fresh installation of 2.8.2.

I'm concerned about these values in the PHP bit you posted:

'Server socket', 'socket'.
What OS are you on? The value should be a path to the socket -- something like '/var/run/mysqld/mysqld.sock' (on GNU/Linux). Try just leaving it empty.

'Compress connection', 'compress'.
Try setting this to false.

'Only database to show', 'only_db'.
Is this an actual database? If not, leave empty.

'Verbose name of this server', 'verbose'.
I suspect this is a filler value, like above. Try setting only the bare minimum values first to check. Most parameters can be left empty.

Smiling

They have: 68 posts

Joined: Jun 2006

Ok... i changed my code to the following:

            array('Server hostname', '147........', 'Hostname where MySQL server is running'),
            array('Server port', '3306', 'Port on which MySQL server is listening, leave empty if don\'t know'),
            array('Server socket', '', 'Socket on which MySQL server is listening, leave empty if don\'t know'),
            array('Connection type', 'tcp', 'How to connect to server, keep tcp if don\'t know', array('tcp', 'socket')),
            array('PHP extension to use', 'mysql', 'What PHP extension to use, use mysqli if supported', array('mysql', 'mysqli')),
            array('Compress connection', 'FALSE', 'Whether to compress connection to MySQL server', FALSE),
            array('Authentication type', 'config', 'Authentication method to use', array('cookie', 'http', 'config')),
            array('User for config auth', 'root', 'Leave empty if not using config auth'),
            array('Password for config auth', '----', 'Leave empty if not using config auth', 'rosebud'),
            array('Only database to show', '', 'Limit listing of databases in left frame to this one'),
            array('Verbose name of this server', '', 'Name to display in server selection'),
            array('phpMyAdmin control user', 'controluser', 'User which phpMyAdmin can use for various actions'),
            array('phpMyAdmin control user password', 'controlpass', 'Password for user which phpMyAdmin can use for various actions', 'password'),
            array('phpMyAdmin database for advanced features', 'pmadb', 'phpMyAdmin will allow much more when you enable this. Table names are filled in automatically.'),
            ),
            'Configure server',
            ($number === FALSE) ? 'Enter new server connection parameters.' : 'Editing server ' . get_server_name($defaults, $number),
            $defaults, $number === FALSE ? 'Add' : '', 'Servers_');
'

But i get the same error. One question i have.. is why it says:

Quote: #1045 - Access denied for user 'root'@'localhost' (using password: NO)

When i'm specifying an IP address rather than localhost in that field?

Also... is there any other part i need to configure to get the install to work? This is the only part of the config file i've touched.

Thanks for your help.

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Hold on. What's in your config.inc.php? It should look a bit like this:

<?php
/*
* Generated configuration file
* Generated by: phpMyAdmin 2.8.2 setup script by Michal &#268;iha&#345; <[email protected]>
* Version: $Id: setup.php,v 1.23.2.10 2006/05/15 07:57:30 nijel Exp $
* Date: Tue, 04 Jul 2006 04:58:32 GMT
*/

/* Servers configuration */
$i = 0;

/* Server localhost (config:root) [1] */
$i++;
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['socket'] = '/var/run/mysqld/mysqld.sock';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '***';

/* End of servers configuration */
?>

That was generated by the setup script at first run. Did you go through that step?

Double check that the file is in the right location too, for phpMyAdmin to read it.

Smiling

They have: 68 posts

Joined: Jun 2006

I'm an idiot.

I figured the config file i had set up seemed wrong. It was a mountain of code with that section i displayed buried in the middle. Either way, your code worked... so i got it set up. Much thanks.

By chance, do you have any experience with Sphider? It has an installation script that builds the tables of the database i set up for it... but i can't seem to get it to work. It errors with this:

Sphider installation script.
0) { print "Error: "; print mysql_error(); print "
\n"; $error += mysql_errno(); } mysql_query("create table `".$mysql_table_prefix."links` ( link_id int auto_increment primary key not null, site_id int, url varchar(255) not null, title varchar(200), description varchar(255), fulltxt mediumtext, indexdate date, size float(2), md5sum varchar(32), key url (url(16)), key md5key (md5sum(16)), visible int default 0, level int)"); if (mysql_errno() > 0) { print "Error: "; print mysql_error(); print "
\n"; $error += mysql_errno(); } mysql_query("create table `".$mysql_table_prefix."keywords` ( keyword_id int primary key not null auto_increment, keyword varchar(30) not null, unique kw (keyword), key keyword (keyword(10)))"); if (mysql_errno() > 0) { print "Error: "; print mysql_error(); print "
\n"; $error += mysql_errno(); } for ($i=0;$i<=15; $i++) { $char = dechex($i); mysql_query("create table `".$mysql_table_prefix."link_keyword$char` ( link_id int not null, keyword_id int not null, weight int(3), domain int(4), key linkid(link_id), key keyid(keyword_id))"); if (mysql_errno() > 0) { print "Error: "; print mysql_error(); print "
\n"; $error += mysql_errno(); } } mysql_query("create table `".$mysql_table_prefix."categories` ( category_id integer not null auto_increment primary key, category text, parent_num integer )"); if (mysql_errno() > 0) { print "Error: "; print mysql_error(); print "
\n"; $error += mysql_errno(); } mysql_query("create table `".$mysql_table_prefix."site_category` ( site_id integer, category_id integer )"); if (mysql_errno() > 0) { print "Error: "; print mysql_error(); print "
\n"; $error += mysql_errno(); } mysql_query("create table `".$mysql_table_prefix."temp` ( link varchar(255), level integer, id varchar (32) )"); if (mysql_errno() > 0) { print "Error: "; print mysql_error(); print "
\n"; $error += mysql_errno(); } mysql_query("create table `".$mysql_table_prefix."pending` ( site_id integer, temp_id varchar(32), level integer, count integer, num integer )"); if (mysql_errno() > 0) { print "Error: "; print mysql_error(); print "
\n"; $error += mysql_errno(); } mysql_query("create table `".$mysql_table_prefix."query_log` ( query varchar(255), time timestamp(14), elapsed float(2), results int, key query_key(query))"); if (mysql_errno() > 0) { print "Error: "; print mysql_error(); print "
\n"; $error += mysql_errno(); } mysql_query("create table `".$mysql_table_prefix."domains` ( domain_id int auto_increment primary key not null, domain varchar(255))"); if (mysql_errno() > 0) { print "Error: "; print mysql_error(); print "
\n"; $error += mysql_errno(); } if ($error >0) { print "Creating tables failed. Consult the above error messages."; } else { print "Creating tables successfully completed. Go to admin.php to start indexing."; } ?>
'

If you can help, i'd really appreciate it. If not... no problemo, you've already done a ton for me.

Thanks again.

waffles's picture

They have: 54 posts

Joined: Jun 2006

I have it installed on my site. But I'm going to bed, so try to catch me later and I'll help you out with it if I can.

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Installed Sphider-1.3.1b without problems. Again, can't reproduce your error. It seems to be spitting PHP code for you, which it shouldn't -- unless you're copying that out of the source file to show here.

Ensure that settings/database.php has all the right values and no syntax errors and typos. A missing ; here or extra " there will certainly cause problems.

If that still doesn't work you can try entering your database in phpMyAdmin, going to "Import", and loading sql/tables.sql. This will do everything install.php is supposed to do.

Edit: ah, beat me to it. Smiling What was the problem?

They have: 68 posts

Joined: Jun 2006

Rather than fret over syntax errors or typos... i imported the tables like you explained (25 queries).

But, as always, with me it's never that easy. The following image is what presents when i access http://localhost/sphider/admin/admin.php

Why it's spitting out all that code.. i'm not sure.

As always, any help is very much appreciated. I bit off more than i could chew with this project.

Busy's picture

He has: 6,151 posts

Joined: May 2001

It's showing the code because PHP isn't running.

Make sure the path is right to localhost.
Say you installed PHP, Mysql and Apache in C:\php\ (and everything else like phpmyadmin), the localhost (http://localhost/) will begin at the php/ folder, calling c:\php will not display the server etc

try localhost or 127.0.01

If you want a easy way out, download the php/mysql/apache bundle from somewhere like firepages.com.au (has the manuals and phpmyadmin etc), I think it's all auto install now, back when I got it, you just had to make a couple of changes in the php.ini file once moved into windows folder

They have: 68 posts

Joined: Jun 2006

I had to install a unique bundle because the newest version of PHP and Apache 2.2 weren't congruent. When i downloaded it, it named itself C:/php5

Could this be the problem? Is Sphider looking in C:/php?

I know PHP is running on the server... because i've tested php-based pages on the localhost.

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Sphider uses short open tags like so:

<?php
code_goes_here
?>

Whereas it seems your server is only configured to run:
<?php
code_goes_here
?>

That would explain why phpMyAdmin runs, it uses long tags. You can fix it by looking for short_open_tag in your php.ini file and setting it to On.

Or you could run a few string search/replaces on all the Sphider PHP files, changing <? to <?php.

Smiling

They have: 68 posts

Joined: Jun 2006

Awesome. You guys are brilliant.

I'm in your debt... yet again.

Really, thank you very much. For my next step, i'll be installing vBulletin, so i'm sure i'll hit a snag and come back...

Thanks again.

Busy's picture

He has: 6,151 posts

Joined: May 2001

You don't have to hit a snag to come back, we don't bite - much Wink

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.