mySQL root password?
Posted by: Ryan Ariff (---.jax.bellsouth.net)
Date: February 02, 2006 02:25AM

This is probably a dumb question. But where do I set the root password for mySQL? I can't seem to figure it out.

Options: ReplyQuote
Re: mySQL root password?
Posted by: Neggerbaby (---.groni1.gr.home.nl)
Date: February 02, 2006 04:30PM

My too, were is the documentation? winking smiley

Options: ReplyQuote
Re: mySQL root password?
Posted by: sukhdev singh (---.hotwireindia.com)
Date: February 02, 2006 07:56PM

Open phpmyadmin click Privileges on main mainu,set root password or your username with password.

root password using MySQL console

open console hit enter

mysql>
mysql>update mysql.user SET password=password("newpassword"winking smiley hit enter
mysql>where user="root"; hit enter
Query OK


mysql>Flush Privileges; hit enter
Query OK
mysql>quit hit enter
mysql>bye

Options: ReplyQuote
Re: mySQL root password?
Posted by: Coen Meerbeek (---.dsl.ip.tiscali.nl)
Date: February 09, 2006 02:58PM

I always use this manual to configure WAMP:
[stanton-finley.net]
[stanton-finley.net]
Works fine for me and you have a good configured MySQL and phpMyAdmin.

Options: ReplyQuote
Re: mySQL root password?
Posted by: Robert (---.eburwd3.vic.optusnet.com.au)
Date: February 09, 2006 03:45PM

Hahaha Yeah I set a MySQL root password and forgot to tell phpmyadmin about it.
That was fun for all of 10 minutes.
Then I edited the phpMyAdmin config.inc file in the c:\wamp\phpmyadmin\ and set the password for root.

(laughs again)

Cheers

Options: ReplyQuote
Re: mySQL root password?
Posted by: rizzocow (---.hsd1.ct.comcast.net)
Date: February 22, 2006 05:31AM

First let me point out that I am fairly new to mysql and php.
Ok, here's what I've done so far.
I installed wamp without a problem. From my understanding, the default user for phpmyadmin and sql is "root" with NO password. I copied the phpbb directory into the www directory. I was able to get to phpmyadmin as well as sqlite. When I tried to run the installation for phpbb I got the message about the @localhost not being able to connect. I cleared the cache, tried again and was able to install it when I used the root user and password. However, as we know, this is not very secure so I changed the root password by performing the following from the console:


mysql>
mysql>update mysql.user SET password=password("newpassword"winking smiley hit enter
mysql>where user="root"; hit enter
Query OK


mysql>Flush Privileges; hit enter
Query OK
mysql>quit hit enter
mysql>bye

I also edited the phpMyAdmin config.inc file to reflect the changed password for the root account. Now here's the part where I want to stick my head through the monitor! When I try to access the phpbb, I get the message " phpbb critical error cannot connect to database" I checked and double checked all that i've read here as well as everywhere else that google will allow me to check. WTF is going on??? No one here seems to have a valid answer either.! If someone can tell me what, precisely, it is that I can do to make this work, or at the very least tell me WHY it's doing what it is...then I'll be MORE than happy to fix the damn thing! I'm not lazy, I love to read and research but c'mon! With everyone who's using this app, no one has an answer to the same problem that I've seen posted here at least 50 times! ( and yes...I read every single one of them)!
At least I was smart enough to make a backup as soon as I was able to access the phpbb the very first time. But in order to connect again I had to ge back and reset the root paswword to the default and that's the only account I can use (for now)! So here's what I'd like to accomplish:

1. Authenticate to mysql and phpmyadmin (as well as phpbb) as a user other than root and set a password for it. And I would like to do this without having the whole damn thing blowup!
2. See item number 1!

Just trying to make it work folks...forgive my frustration please! Any help would be greatly appreciated.

Options: ReplyQuote
Re: mySQL root password?
Posted by: tuyennguyencanada (---.sktn.hsdb.sasknet.sk.ca)
Date: November 07, 2009 12:52AM

You can reset the root password as instruction in this link:
[dev.mysql.com]

Options: ReplyQuote
Re: mySQL root password?
Posted by: yfastud (Moderator)
Date: November 07, 2009 02:18AM


Options: ReplyQuote
problem with runing phpmyadmin
Posted by: nachle_gale (---.meb800.vic.optusnet.com.au)
Date: January 31, 2010 02:00PM

hi all
i have installed wampserver with mysql and php

i have tried to run phpmyadmin, before that i changed the congog.inc file and added these values:
<?php
$i=0;
$i++;
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = ''; // use here your password
?>

as suggested in documentation of phpmyadmin

the problem is that i do not have any password set on the mysql server but whenever i try to run phpmyadmin it asks for the password. in the username i fill 'root' and on leaving password section "BLANK" it do not allow me to enter.....i don't have any password set so that should i enter there or where to make changes to run it smoothly.

on the other hand i am able to run mysql code without password in php files


help please

Options: ReplyQuote
Re: mySQL root password?
Posted by: yfastud (Moderator)
Date: January 31, 2010 05:11PM


Options: ReplyQuote
Re: mySQL root password?
Posted by: suhashankare (---.244.79.168.static-lvsb.vsnl.net.in)
Date: December 15, 2011 12:08PM

It works on my localhost

Thanks smiling smiley

Suhas Hankare..

Options: ReplyQuote
Re: mySQL root password?
Posted by: saurabh (117.229.29.---)
Date: January 09, 2012 03:03PM

i have an error while
mysql> where user="root";
error is ::

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 1

what shud i do???

Options: ReplyQuote
Re: mySQL root password?
Posted by: futte0975 (87.54.39.---)
Date: February 08, 2012 02:34PM

To change the root password successfully I had to add "skip-grant-tables" in my.ini (added it just below skip-networking) and restarted the server.

Used the mysql console to fire the commands:

mysql> update mysql.user set password=password("newPassword"winking smiley where user="root";
mysql> flush privileges;

Remember to remove or comment out the "skip-grant-tables" afterwards, no need to have it activated for normal use.

Options: ReplyQuote
Re: mySQL root password?
Posted by: tanveer (113.11.27.---)
Date: September 05, 2012 09:31AM

saurabh Wrote:
-------------------------------------------------------
> i have an error while
> mysql> where user="root";
> error is ::
>
> 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 1
>
> what shud i do???

I have the same problem. i am using wampserver 2.2 and can't change the password using where user

Options: ReplyQuote
Re: mySQL root password?
Posted by: Dandello2000 (184.10.218.---)
Date: December 17, 2012 02:13AM

AAK!

I'm having the same problem. I reset the mySQL password using the downloaded reset files from
[downloads.jlbn.net]

then I followed the instructions from [blog.jlbn.net]

Now I'm locked out of phpMyadmin - it brings up the login box and that's it. I put in the password and it gives me another login box.

I reset the the mySQL password again and rolled back the config.inc.php and I've still got the password box popping up.

What have I missed?

Options: ReplyQuote
Re: mySQL root password?
Posted by: tanveer (113.11.10.---)
Date: December 25, 2012 02:59PM

thanks. it works.

Options: ReplyQuote
Re: mySQL root password?
Posted by: acnow (---.sip.mia.bellsouth.net)
Date: January 15, 2014 02:06AM

I installed about 2 months ago a version of wamp on my C drive and set a MySQL password).
- Today I uninstalled it and reinstalled it again on my E drive where I have more space. When I tried to open mysql console asked me for the password and I entered the right password but it is not working.
I tried to follow the steps below command via the Command Prompt as Administrator:

USE mysql;
UPDATE mysql.user SET password=PASSWORD('mypassword') WHERE user = 'root';
FLUSH PRIVILEGES;


(here is the link to what I did: [www.youtube.com])

but then it is giving me this error at the end: [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option

I don't have "linux command" installed on my computer just the Window Prompt Command. Please, any help here will be much appreciated! Thanks, AC

Options: ReplyQuote
Re: mySQL root password?
Posted by: acnow (---.sip.mia.bellsouth.net)
Date: January 15, 2014 04:25AM

ok.. guys I found the answer and it worked! I was able to change the password and access mysql console. The answer below came from this website: [www.justanswer.com]



In case you forgot the root password XXXXX your MySQL database server running under Microsoft Windows, you can still access your database and even reset your password XXXXX the command prompt. However, first you should check your my.cnf file where your password XXXXX XXXXX

If you are using a new version of MySQL Server, such as 5.0, the methods here might not work for you, or slightly different actions may need to be applied.

1. Stop your MySQL server completely. This can be done by accessing the Services window inside Windows XP and Windows Server 2003, where you can stop the MySQL service.

2. Open your MS-DOS command prompt using "cmd" inside the Run window. Inside it navigate to your MySQL bin folder, such as C:\MySQL\bin using the cd command.

3. Execute the following command in the command prompt: mysqld.exe -u root --skip-grant-tables

4. Leave the current MS-DOS command prompt as it is, and open a new MS-DOS command prompt window.

5. Navigate to your MySQL bin folder, such as C:\MySQL\bin using the cd command.

6. Enter "mysql" and press enter.

7. You should now have the MySQL command prompt working. Type "use mysql;" so that we switch to the "mysql" database.

8. Execute the following command to update the password:

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

However, you can now run any SQL command that you wish.

After you are finished close the first command prompt and type "exit;" in the second command prompt windows to disconnect successfully. You can now start the MySQL service.

Options: ReplyQuote
Re: mySQL root password?
Posted by: acnow (---.sip.mia.bellsouth.net)
Date: January 15, 2014 05:44AM

PS: in step 8 there was a problem with syntax. This one was the one that worked:

UPDATE mysql.user SET password=PASSWORD('mypassword')WHERE user='root';

Options: ReplyQuote
Re: mySQL root password?
Posted by: RiggsFolly (---.as13285.net)
Date: January 15, 2014 12:41PM

How to reset the MySQL root userid with WAMPServer.

As this previous suggestion did not work using a WAMPServer installation and I have been meaning to work out a nice clean way to do this for some time now heres how its done using WAMPServer.





1. Stop the mysql service
wampmanager -> MySQL -> Service -> Stop Service

2. Edit the my.ini file
wampmanager -> MySQL -> my.ini

3. Find the [wampmysqld] section in the ini file
Add this line directly after the section [wampmysqld]
skip-grant-tables

4. Restart the mysql service.
wampmanager -> MySQL -> Service -> Start/Resume Service

5. Open a command window
At the command prompt change to the drive letter you installed wamp on ( D: in my case )
D:
CD into your mysql's executable folder (replace X,Y and Z with the versions number you are using )
CD \wamp\bin\mysql\mysqlX.Y.Z\bin

6. Now we are going to reset the password for the root user, of course this could be used to reset any users password.

Form the command prompt, run the mysql command line processor

mysql.exe

and enter the following 2 commands at the mysql> command prompt, each with a semi colon at the end of a line, and press ENTER after each line to issue the command to mysql.
   UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
   FLUSH PRIVILEGES;

Note that the update should report that it has updated more than one row, that because there are actually 3 user accounts with the userid of 'root' each with a different domain i.e. 127.0.0.1, localhost and ::1

7. Now enter 'quit' at the mysql command promt to exist mysql.

8. Stop the mysql service
wampmanager -> MySQL -> Service -> Stop Service

9. Edit the my.ini file
wampmanager -> MySQL -> my.ini

10. Find the [wampmysqld] section in the ini file
Remove the 'skip-grant-tables' parameter we added earlier.
DO NOT Leave this parameter in the ini file its a HUGH security hole.

11. Restart the mysql service.
wampmanager -> MySQL -> Service -> Start/Resume Service

You shoud now be able to login with phpmyadmin using the userid 'root' and the new password you have just set for that user.

_______________________________________________________________________________________________________________
Windows 7 Pro 32bit running Wampserver 2.4 32bits
< Apache Versions 2.4.6 / 2.4.4 / 2.2.26 / 2.2.24 / 2.2.23 / 2.0.63 > < PHP 5.5.3 / 5.4.16 / 5.4.15 / 5.4.11 / 5.3.22 / 5.3.17 / 5.3.13 / 5.3.1 / 5.2.9 / 4.4.9 > < MySQL 5.6.14 / 5.5.28 / 5.5.24 > < phpMyAdmin 4.1.9 > < MySQL Workbench 5.2.45 >

Never try and remember anything you can look up in a book. In other words, when all else fails R.T.F.M.

Apache Documentation [httpd.apache.org]
MySQL Documentation [dev.mysql.com]
PHP Documentation [php.net]

Options: ReplyQuote


Sorry, only registered users may post in this forum.