Forum Moderators: coopster

Message Too Old, No Replies

cannot connect phpmyadmin with mysql

Trying to follow the instructionson the board

         

satsteve

8:27 pm on Dec 14, 2004 (gmt 0)

10+ Year Member



I tried to Verify that MySQL and Apache are running...
On line 84 of config.inc.php found in the pma file .... /apache group/apache2/htdocs I put in my root password for mysql for example if my password was apples should it look like this.....

$cfg['Servers'][$i]['password'] = 'apples';

I typed [localhost...] and got the following message

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:

#1251 - Client does not support authentication protocol requested by server; consider upgrading MySQL client

I am so close thanks to your instructions I can almost taste it!

Is there a way of openeing mysl and seeing what I need to enter? I only made a note of the root password, nothing else.
Please advise

coopster

9:37 pm on Dec 14, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Probably has something to do with the version...

[webmasterworld.com...]

Salsa

10:12 pm on Dec 14, 2004 (gmt 0)

10+ Year Member



So, how did you find that, coopster? I knew I'd recently seen it more than once and looked for it with a site search, but I couldn't find it on any of the more likely keywords.

coopster

1:07 am on Dec 15, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



hehe. I've answered the question so many times I have it bookmarked ;)

I hit this problem during beta testing so I have known about this issue for some time now.

satsteve

12:06 pm on Dec 15, 2004 (gmt 0)

10+ Year Member



I know my root password but how do I put it in here?
this is what would like ot try first.....
use the example of my password being apples and i want to cahnge it to pears....

Reset the password to pre-4.1 style for each user that needs to use a pre-4.1 client program. This can be done using the SET PASSWORD statement and the

OLD_PASSWORD() function:
mysql> SET PASSWORD FOR
-> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');

please advise

coopster

1:07 pm on Dec 15, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I just log into mysql as "root" via the command line and use an UPDATE statement on the mysql.user table directly.
UPDATE mysql.user SET Password = OLD_PASSWORD('pears') WHERE User = 'root'; 
FLUSH PRIVILEGES;
This will update the password of all occurrences of User "root" in the table.

SET_PASSWORD [dev.mysql.com]

satsteve

6:58 pm on Dec 15, 2004 (gmt 0)

10+ Year Member



I tried what you suggested but with a different new password.. and I got a new error message
error1064 (42000): You have an error in your sql syntax; check the manual corresponds to your Mysql server version for the right syntax to use near '('pear') WHERE User = 'root'' at line 1

WHAT DOWES THIS MEAN?!

What about On line 84 of config.inc.php found in the pma file .... /apache group/apache2/htdocs I put in my root password for mysql for example if my password was apples should it look like this.....
$cfg['Servers'][$i]['password'] = 'apples';

Please advise

coopster

7:16 pm on Dec 15, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



What version of MySQL are you running?

satsteve

10:11 pm on Dec 15, 2004 (gmt 0)

10+ Year Member



It is mysql4.1.7

I think it is the latest it was a 36.6mb download!

coopster

10:38 pm on Dec 15, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



The two statements I put there need to be run as two separate querys when doing it through an HTML interface. Like I said, I usually run them through the command line interface.

satsteve

1:08 pm on Dec 16, 2004 (gmt 0)

10+ Year Member



I entered the code you suggested in the mysql interace (black background) so please explain further what you mean please.

coopster

2:27 pm on Dec 16, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I meant that I open the interface, as you did, login as 'root' and use the 'mysql' database. Then I run the command
UPDATE mysql.user SET Password = OLD_PASSWORD('pears') WHERE User = 'root';
After that command runs successfully, you need to flush the privileges:
FLUSH PRIVILEGES;
If the first command isn't running successfully, I'm not sure why. The syntax should be fine...

satsteve

5:48 pm on Dec 16, 2004 (gmt 0)

10+ Year Member



No, I am not getting this at all!

This is what I tried....

I opened up mysql from Start>All Programs>Mysql>mysql command client (black background).

Then it prompts me to Enter Password: I do and it then leaves ......mysql>..... for me to begin.

I typed exactly what you suggested exept for the password....
UPDATE mysql.user SET Password = OLD_PASSWORD ('pears') WHERE User = 'root';

Then I pressed enter.

It then showed... Query OK, 2 rows affected (0.00 sec)
Rows matched: 2 Changed: 2 Warnings: 0

mysql>

So I then typed FLUCH PRIVALEGES;.....

I get ERROR 1064 (42000): You have an error in your aql suntax; check the manual that corresponds to your MySQL server version for the right syntax to use tnear 'PRIVALEGES' at line 1

What is going on!?

Salsa

6:02 pm on Dec 16, 2004 (gmt 0)

10+ Year Member



FLUCH PRIVALEGES;

is misspelled. Exact spelling is essential;

FLUSH PRIVILEGES;

satsteve

6:13 pm on Dec 16, 2004 (gmt 0)

10+ Year Member



Thanks but with respect that is only what I typed out on the forum, not what I typed in mysql. You get me worried though so I tried a 101st time and it still gave the same reply.

What is going on?!

coopster

6:20 pm on Dec 16, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member




It then showed... Query OK, 2 rows affected (0.00 sec)
Rows matched: 2 Changed: 2 Warnings: 0

Well, then you have updated the password for userid 'root'. Which userid and password are you using in your script?

satsteve

7:00 pm on Dec 16, 2004 (gmt 0)

10+ Year Member



....Which userid and password are you using in your script?

------------------------------------

By script I hope you mean the line 84 of config.inc.php!

How do I know my user ID?! I was not asked for it when I set up mysql, only the root password and email was asked for then...

I changed line 84 in config.inc.php so it has the new password.

How do I find my username?

At what stage shpuld I have chosen my username or is it my computers name? Ahhhhhh

I typed [localhost...] and got th same old message.

I also just went into mysql command prompt and it promted me to use my password and it only accepted my original one and not the new one! You implied it accepted my new password or have I got it wrong (Again!)

Salsa

8:08 pm on Dec 16, 2004 (gmt 0)

10+ Year Member



Sorry about the misspelling thing, satsteve, but I couldn't think of another reason why you'd get a syntax error for FLUSH PRIVILEGES; --and you used the same misspelling, 'PRIVALEGES', twice in your post, so it seemed the most likely problem.

If Reload_priv aren't set for a user, you should get an "Access denied" message, not a syntax error, so if "FLUSH PRIVILEGES;" really does return a syntax error, I'd have to think the unlikely scenarion that there's something broken in your installation. And if you can't FLUSH PRIVILEGES, the new password isn't going to work.

Maybe try another FLUSH statement, like

FLUSH LOGS;

...to see if FLUSH is working for you at all.

As a minor point, I also noticed that 2 rows were affected when you updated the root password, so I'm guessing that one root user has Host as %, which you might want to delete. If you do that, however, be very careful with your WHERE clause that you don't delete both root users!

To see what users you've have, and their privileges, you might

USE mysql; 
SELECT * FROM user;

To see what user you're logged in as

SELECT CURRENT_USER();

Sorry I wasn't more help.

satsteve

9:15 pm on Dec 16, 2004 (gmt 0)

10+ Year Member



My hair is falling out faster than I can grow it at this stage!

I trid to FLUSH LOGS; and got the following..
Query OK, 0 rows affected (0.00 sec)

SELECT CUURENT_USER();
---------------------
CURRENT_USER()
---------------------
root@locahost
---------------------
1 row in set (0.01 sec)

I then exitedly went to the config.inc.php to put the user in line 83 ...it cuuently reads $cfg['Servers'][$i]['user'] = 'root'; // MySQL user

so I deleted in between ''and put 'root@localhost';

It did not work

where is the light?

Salsa

9:58 pm on Dec 16, 2004 (gmt 0)

10+ Year Member



Well, it's still not going to work until you can FLUSH PRIVILEGES. The FLUSH LOGS didn't do anything meaningful except to show that FLUSH works. I'm sorry for asking again, but are you absolutely certain that you are getting

FLUSH PRIVILEGES;

...spelled right? That's the only possible reason I can think of why you'd get a syntax error.

satsteve

3:25 pm on Dec 17, 2004 (gmt 0)

10+ Year Member



I gave up last night and turned the machine off..........you know whats comming..... I turned on the maching and flushed those pesku privileges and it worked!

Thanks very much indeed for your help..

Happy holidays