Page 1 of 1

Are passwords used differently in Xampp 1.8

PostPosted: 12. January 2013 22:40
by hwalker1
I have been using an earlier version of Xamp for a while. Recently I installed 1.8 on my Win7 64 bit computer.
Installation went well, and I could access MySQL from the control panel and run php. So I set up a site in htdocs in the Xampp directory of my C drive. I then went on line to the server and downloaded my files from the net with no problems. I then accessed my on line database and downloaded it in MySQL format and dumped it into the new MySQL using the PhpMyinfo import / export method. I set the passwords and access rights to be identical to the ones that I had on my old system. I made no changes to any of the "ini" files, assuming that the default ones would work, like they did when I installed earlier versions of Xampp. The data files are all on my computer and can be viewed.
I now have problems.
In my earlier version, I could access mysql from the control panel and programatically using a username other than the root username. Now I cannot. Only the root password works. Other users that I have set up cannot connect at all. My code has not changed, and as far as I can see I have the same usernames and passwords. Do I need to make any changes to the standard ini files? Is it normal for only the root user to be able to access via the control panel in 1.8? I was always told that to use the root for a live site was dangerous as this would be bad security.
Here is the connection script that I use as an include file:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_conshipsviewer = "localhost";
$database_conshipsviewer = "databasename"; /*not the root user */
$username_conshipsviewer = "username";
$password_conshipsviewer = "xxxxxxxxxxxxxxx";
$conshipsviewer = mysql_pconnect($hostname_conshipsviewer, $username_conshipsviewer, $password_conshipsviewer) or trigger_error(mysql_error(),E_USER_ERROR);
?>
It works currently on two versions of Xampp but not with 1.8
Can anyone help please?

Re: Are passwords used differently in Xampp 1.8

PostPosted: 12. January 2013 23:08
by hackattack142
If you open your /xampp/phpmyadmin/config.inc.php and change the line "$cfg['Servers'][$i]['auth_type']" from "config" to "cookie". That should let you choose which user to login with when you go to phpMyAdmin.

yes, using root for a live site is dangerous (see SQL Injection).

Re: Are passwords used differently in Xampp 1.8

PostPosted: 13. January 2013 01:27
by hwalker1
Thanks for that - it was already set to cookie.
Worse still, while trying to solve the problem, I thought that as root worked OK, I would create a new user with the same priviledges as root.
So now I have 2 users called root and cannot access the thing at all!
I can change the password for root from outside, but with two users called root, it just will not accept a password.
Have you come across that before? After I added the new user, I could not find any way to change the name of that user. Once I had logged out that was it. Looks like a new installation is needed - unless you know better?

Re: Are passwords used differently in Xampp 1.8

PostPosted: 14. January 2013 17:00
by hwalker1
I saved my databases and sites, stopped all related services and deleted the Xapp directory.
I re-Installed the old version, Logged in as root and set up a user with all priviledges. Logged out and then logged in with the new user - perfect!
Repeated the process with 1.81 version. Logged in as root and set up a user with all priviledges. Logged out and tried to log in with the new user. No success. Most frustrating.
There must be something else that needs doing before Xampp 1.8 can be used but I cannot find it.
Suggestions please?

Re: Are passwords used differently in Xampp 1.8

PostPosted: 15. January 2013 00:03
by hackattack142
Are you making your new user with the 'localhost' or '%' host?

If you use the wildcard (%), you cannot use that user to login as localhost and vice versa. If you want a user for both you need to create 2 users, one with each host type.

Re: Are passwords used differently in Xampp 1.8

PostPosted: 15. January 2013 00:31
by Altrea
hackattack142 wrote:If you use the wildcard (%), you cannot use that user to login as localhost and vice versa. If you want a user for both you need to create 2 users, one with each host type.

Thats not completely correct.

If more than one user matches for a login MySQL has to choose which user to login, and that will always be the most specific one. The order is the following (% = Any):
user@host (most specific)
%@host
user@%
%@% (least specific)

Because there is a default user %@localhost which is more specific than the user user@% that user will have a higher priority to login.
So, if someone would like to use login users for any host from localhost too, the default user %@localhost have to be deleted or you have to specify a second user with a higher priority like user@localhost too.

best wishes,
Altrea

Re: Are passwords used differently in Xampp 1.8

PostPosted: 15. January 2013 02:47
by hwalker1
hackattack142 wrote:Are you making your new user with the 'localhost' or '%' host?

If you use the wildcard (%), you cannot use that user to login as localhost and vice versa. If you want a user for both you need to create 2 users, one with each host type.


By sheer fluke I am using user@localhost, as I am using windows on a windows server (locally and on line)
While working on this problem, I found that if I exported the sql for the root user's privileges, change the name of the user, and ran the sql in the sql panel, it created a user with the root password and could use it to log in. However. I then changed the new user's password but could no longer log in. Editing the original exported root code to include the new user's name and password, and then executing it in sql, and I had a new user with full privileges that could log in with a new username and password. Convoluted but it worked - up to a point. And I still cannot work out why it is necessary to do this, when I should just be able to create a user@localhost with full privileges using the add new user page.

Re: Are passwords used differently in Xampp 1.8

PostPosted: 15. January 2013 06:12
by Altrea
hwalker1 wrote:And I still cannot work out why it is necessary to do this, when I should just be able to create a user@localhost with full privileges using the add new user page.

We don't know either. That is exactly the way it's working for us. I don't have any problems creating a new user with the create user function of phpmyadmin.

Re: Are passwords used differently in Xampp 1.8

PostPosted: 15. January 2013 18:26
by hwalker1
I can create one but getting it to have the same characteristics as the root user is exceeding difficult.

Re: Are passwords used differently in Xampp 1.8

PostPosted: 10. April 2013 11:38
by zacken542
I need to Change host of that user from % (any) to localhost in user privilegs
or connect using "computer name"
Sven Åke