[SOLVED] MySQL - phpMyAdmin config file

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
maxpax
Forum Newbie
Posts: 18
Joined: Tue Aug 01, 2006 5:38 am
Location: England

[SOLVED] MySQL - phpMyAdmin config file

Post by maxpax »

I am new to this MySQL and phpMyAdmin and I am trying to create the config file so that I can access phpMyAdmin to sort out my database.
The MySQL server is on the same machine as phpMyAdmin and I can't get the graphical set up to work. I created the folder name config but when I click 'add' to add a server nothing happens.

So I have resorted to trying to create the config file myself which for a newb like me is not easy. phpMyAdmin still won't accept the database user name and password, this is my config file:

Code: Select all

<?php

$i=0;
$i++;
$cfg['Servers'][$i]'root'; 
$cfg['Servers'][$i]'password goes here';
?>
Anyone got any ideas on how to sort this out. Thanks :)
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Did you try the install wizard?
It explained in Documentation.html (comes with the phpmyadmin archive)
phpMyAdmin-2.8.2.1/Documentation.html wrote:Now you must configure your installation. There are two methods that can be used. Traditionally, users have hand-edited a copy of config.inc.php, but now a wizard-style setup script is provided for those who prefer a graphical installation.
maxpax
Forum Newbie
Posts: 18
Joined: Tue Aug 01, 2006 5:38 am
Location: England

Post by maxpax »

Yeah it isn't really a wizard. It is a webapge with buttons on that take you to different pages to input things like usernames and passwords. But whenever I click on any of the buttons nothing happens.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Are you just tryig to set up PMA? For the first time? You shouldn't have to do anything more than edit three lines in the config file that is already there.
maxpax
Forum Newbie
Posts: 18
Joined: Tue Aug 01, 2006 5:38 am
Location: England

Post by maxpax »

That's what I am doing. I leave everything how it is and just add in my password. But it says access denied.
I take it the root password is the one which you put in when you set up MySQL.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Access denied could be for a number of reasons. The first is that you are logging in as a user that has no permissions. Which user are you using as the logged in user? For my development machine, I set the user to 'root' (the MySQL SuperUser with all rights) and the password to that of my 'root' superuser. You can use any user in the MySQL database, so long as that user has the appropriate permissions to do what needs to be done in the database.

The next, more common issue that leads to this error, is that your MySQL Client API version is older than what is expected by your current version of MySQL. This is most commonly associated with using a MySQL version of 4.1+ but with a MySQL API of 3.23 or lower. You can easily modify the MySQL configuration file (my.conf) to modify the password algorithm used by MySQL. You can search these boards for 'MySQL old-password' and you should get something.
maxpax
Forum Newbie
Posts: 18
Joined: Tue Aug 01, 2006 5:38 am
Location: England

Post by maxpax »

Ok, my Client API Version is 3.23.49, so that is probably the problem. Is there any way to upgrade the client API?

If not the old password thing that you talked about. I found this code while searching the forum, is this the kind of thing I need to execute.

Code: Select all

GRANT ALL PRIVILEGES ON root TO root@localhost IDENTIFIED BY 'your_password'; 
UPDATE mysql.user SET PASSWORD = OLD_PASSWORD('your_password') WHERE user = 'root'; 
FLUSH PRIVILEGES;
Am I close, or have I got it tootally wrong. Which is quite possible as I am new to this.

Thanks for the help by the way. :D
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

That is the first step. The second step is editing your my.conf file, in the [mysqld] section and adding in the setting '-old-passwords'. Restart MySQL and you should be golden.
maxpax
Forum Newbie
Posts: 18
Joined: Tue Aug 01, 2006 5:38 am
Location: England

Post by maxpax »

Silly question time! :)

Where is this file or do you mean the config file that I have created?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

On Windows, it should be in c:\Program Files\MySQL Server {VERSION}\. The name of the file is actually my.ini. Scroll through it for about 40 lines or so (depending on your set up) until you find the line that says:

Code: Select all

[mysqld]
Somewhere after that add

Code: Select all

-old-passwords
maxpax
Forum Newbie
Posts: 18
Joined: Tue Aug 01, 2006 5:38 am
Location: England

Post by maxpax »

It is still not working for me at the moment. So here is my config.inc.php (with password replaced):

Code: Select all

<?php

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

?>
And this is where I have put old_password in the my.ini file:

Code: Select all

# SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this 
# file.
#
[mysqld]

# The TCP/IP Port the MySQL Server will listen on
port=3306

old_passwords

#Path to installation directory. All paths are usually resolved relative to this.
basedir="D:/Program Files/MySQL/MySQL Server 4.1/"
I think I have probably put the old_password code in the wrong place in the file, but being new to this really I have no idea! :)
Any ideas?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Right place, wrong syntax...

Code: Select all

old-passwords
or

Code: Select all

old-passwords=1
Neat little link to help out also...
maxpax
Forum Newbie
Posts: 18
Joined: Tue Aug 01, 2006 5:38 am
Location: England

Post by maxpax »

Yes, thanks for the help 8) . I have got it working now. :D
Post Reply