change of password in MySQL

Alles, was MariaDB und MySQL betrifft, kann hier besprochen werden.

change of password in MySQL

Postby donAlgodon » 18. November 2009 13:52

Hi,
sorry if this question is too basic, I'm pretty new on web development.
I've just installed xampp and works seamlessly.
Playing a little with the control panel I went to MySql Admin; then the phpMyAdmin poped up. Among other things a text displayed the following message:

Code: Select all
Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account. Your MySQL server is running with this default, is open to intrusion, and you really should fix this security hole by setting a password for user '.root'.


I then edited the root privileges of root user, scroll down to the change password section, clicked on password, typed a password of my choice, re-typed it and clicked on the go button. Less than a second afterwards, there was a message saying the password had been changed correctly, offering one button to edit and another to create php code, none of which I did.

Until here, no problem. However, when I tried to admin again MySql, there was an error message saying the following:

Code: Select all
 MySQL said:
Documentation #1045 - Access denied for user 'root'@'localhost' (using password: NO)
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.


What am I doing wrong? What am I missing? I would appreciate any helping hand with the issue.

Thanks,
donAlgodon
 
Posts: 4
Joined: 18. November 2009 13:27

Re: change of password in MySQL

Postby Nobbie » 18. November 2009 13:56

Proceed to the phpmyadmin-folder inside your Xampp installation, edit file "config.inc.php" and supply the root-Password at the appropriate line (you wil find it easily, just search for "root" and you will see whats happening there).
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: change of password in MySQL

Postby donAlgodon » 18. November 2009 14:12

Thank you Nobbie, it fixed the problem.
I noticed also a line saying:
Code: Select all
$cfg['Servers'][$i]['AllowNoPassword']      = true;


and changed it to false.
Is that alright, or should I leave it to true?

Thanks
donAlgodon
 
Posts: 4
Joined: 18. November 2009 13:27

Re: change of password in MySQL

Postby donAlgodon » 18. November 2009 14:27

Sorry again, on the same problem.
After doing what you said, I can access the phpMyAdmin but apparently I still can't access to the database I was building using the tutorial on the Quick Start; that is at the browser:
http://localhost/joomla15/administrator
there is an error message saying:
Code: Select all
Database Error: Unable to connect to the database:Could not connect to MySQL


Any idea?

Thanks,
donAlgodon
 
Posts: 4
Joined: 18. November 2009 13:27

Re: change of password in MySQL

Postby Nobbie » 18. November 2009 15:03

donAlgodon wrote:http://localhost/joomla15/administrator
...
Any idea?


Of course, same problem. When installing Joomla, you did not provide a password for root-MySQL-User.

I dont know where Joomla stores this settings, but it must be a file (i.e. config.php) somewhere in Joomla. You have to provide your password there as well as in phpmyadmin (only the syntax may differ).

If in doubt, ask a Joomla forum where to change the MySQL Password.

P.S.: I found a "configuration.php" in the toplevel joomla folder and it looks good. The entry "var $password = ..." should be the MySQL Password.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: change of password in MySQL

Postby donAlgodon » 18. November 2009 16:16

Thank you again. Now works fine.
Just to summarize in case someone else bumps on the same problem: to set a root password after installing xampp and joomla I'll tell what I did:

    1. Edit the xampp\phpMyAdmin\config.inc.php file; locate the empty field password for root and write a passwordOfMyChoice.
    2. Open a shell on the Xampp control panel; type: mysqladmin -u root password passwordOfMyChoice
    3. Edit the xampp\htdocs\joomla15\configuration.php file; locate the empty field password for root and write passwordOfMyChoice.

Thanks,
donAlgodon
 
Posts: 4
Joined: 18. November 2009 13:27


Return to MariaDB - MySQL

Who is online

Users browsing this forum: No registered users and 3 guests