I am following a course on lynda.com

First I had XAMPP, but I had some problems with it, and when the guy who was explaining everything used WAMP, I thought it was easier to just uninstall XAMPP and install WAMP.

So i did that, but the XAMPP installer said it was unable to uninstall the mysql directory.

In the course the guy is doing this:

mysql> UPDATE user
-> SET Password=PASSWORD<'OtlPHP07'>
-> WHERE user='root';

On his computer is says: Query OK, 1 row affected (0.00) sec etc.

I get the error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'WHERE
user='root'' at line 3

What am I doing wrong?
I think Im having problems because I had a MYSQL before but not configured it right, now the XAMPP is still in my C:\ because of the MYSQL file in there.

Really don't know what to do now.

Oke, now I CAN delete my MYSQL because I stopped al mysql process. So the xampp is fully deleted. But, still getting the SAME error.

Your Error message says there is an error in the syntax of the mysql command you are entering.
It says you have a syntax error in the command:

UPDATE user SET Password=PASSWORD<'OtlPHP07'> WHERE user='root';

I think those should be round brackets? i.e.

UPDATE user SET Password=PASSWORD('OtlPHP07') WHERE user='root';


Thanks for answering, im off to work now so cant check if its ok. Thanks for your answer, but the error goes about the where user=root, does that even care or?

Again thanks for reply!

Additional info: I have win7

Sorry i forgot to say this is in command prompt..

The command prompt should not make any difference ( I don't think! ), but the manual says PASSWORD( ... ) - Round brackets, not square.

Thank you so so so much!
Thanks for your help, muhh i was stressing that I (sorry for my language) fked up my MySQL. Again thank you so much!

And the ( looks like a > in command promp, really really looks like, its only a bit different.

This is what my command promp is saying:
Query OK, 2 rows affected (0.09 sec)
Rows matched: 2 Changed: 2 Warnings: 0

The guy that gives the course has this:
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

Why do I have the 2 and he has the 1?

It's difficult to say without knowing what's in your database, and what command exactly you used. If you used..

UPDATE user SET Password=PASSWORD('OtlPHP07') WHERE user='root'

It means the command found two records in your table where the 'user' is called 'root'.



and you should get a listing of everything in your table... You should see in the column 'user', two instances of 'root'

PS: You have published your root password on the web - make sure you actually use a different one from what you have displayed online. i.e...

UPDATE user SET Password=PASSWORD('something-different-here') WHERE user='root'

and keep whatever you use secret ( because mysql can talk from one computer to another, it is a server ).

Haha yeah i got screencontrolled yesterday night, i really was flipping out back then.
Oke so now i changed everything again into another password, configured it in config.inc.php. etc etc. Configured it everywhere. My problem now is, when i go to wamp > PHPmyadmin it says
MySQL retourneerde:

#1045 - Access denied for user 'root'@'localhost' (using password: YES)
phpMyAdmin probeerde met de MySQL-server te verbinden maar de server weigerde de verbinding. Controleer de machine, de gebruikersnaam en het wachtwoord in config.inc.php en zorg er voor dat deze overeenkomen met de informatie die u van de Beheerder van de MySQL-server kreeg.

This is in dutch, but its the same code as in english.

BUT, in the left bottom screen, there is a button Open new phpmyadmin screen. When i click on that it goes to phpmyadmin: http://localhost/phpmyadmin/index.php?target=navigation and then alot of codes behind it. I am scared not to publicy those codes for getting screencontrolled again haha lol. But i CAN make new databases, only my localhost/phpmyadmin doesn't work.

Any solutions?

Well, you're going off my radar with PHPMyAdmin - I don't use it all that much, and can only guess..
Whatever password you have configured, somewhere in the works, it retains an incorrect password. This could be a config file, or in the MySql table.

My first thoughts are, you need to set the root password again, you need to know FOR SURE what root password is, and probably PHPMyAdmin config will need to know too.

There are several instructions about how to reset your mysql password, and it depends what version of mysql you have installed. Make sure the set you follow match you version. Hopefully one of these two will be what you need. READ THEM FIRST - to make sure you have a clear idea of every step required. If there's a part you can't follow because you can't find the file or registry area mentioned, go no further until you know why not.

MySQL's own instructions:http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

Custom Instructions for a slightly more messed up system.

Ty, when i'm home ill see if it worked. Thanks for helping me out.

Good luck. Let us know how you get on.

Thanks for the good luck, it helped. I'm gonna reboot my system alot more when i add some changes. I just shut off my computer, got off to work, got back: WAMP > MyPhpAdmin

BAM: Localhost/PhpMyadmin

Ya-ay! :-)

What can someone do when they have my MySQL password? Because someone was on my screen, not this night before but the night before that. Can they install a keylogger? I switched off my computer in 2 mins after the screen started shaking and icons started switching. I'm really curious if they can install a keylogger? Because if so, he has all my passwords.

Hello again Dannis86.

I am not an expert on this, but I don't think so - Unless you keep all your other passwords in your mysql database?

Your mysql password only pertains to accessing your mysql databases. And, in anycase you should change it if you are in doubt.

If someone has gained access to your system, it would likely have been by some other means - not mysql. You should initiate a scan of your computer with your ( up to date! ) virus protection software to check whether you have been infiltrated. If it finds anything, follow the instructions to get rid of the culprit.


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.