Community Forums

[0.7.9RC8] No match for Username and/or Password

Enter all OpenCart 0.x bugs here

[0.7.9RC8] No match for Username and/or Password

Postby dad » Wed Jan 28, 2009 5:33 pm

I installed RC8 on a new localhost site (Vista Ultimate, Apache 2.2.4, Mysql 5.1.30, PHP5)
and found the same problem as in RC7. The user database table is empty after installation.

http://forum.opencart.com/index.php/topic,2797.0.html

No match for Username and/or Password
dad
 
Posts: 39
Joined: Mon May 26, 2008 8:30 pm

Re: [0.7.9RC8] No match for Username and/or Password

Postby Qphoria » Wed Jan 28, 2009 6:32 pm

This seems to only affect you still :(.
Is there anyway you can forward the port so I can get access to your localsite and take a look?
I'd need the url (i.e. http://72.43.53.24/shop)
ftp access and
the phpmyadmin login.

At the very least, can you tell me if the database is being populated at all and can you export the database to a sql file and attach it so I can take a look

I run my locahost server on Vista Ultimate, Apache 2.2.4, Mysql 5.1.30 and PHP 5.2.0 as well with no problem. What hosting package do you use? Have you tried Xampp or EasyWamp?
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18208
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: [0.7.9RC8] No match for Username and/or Password

Postby dad » Thu Jan 29, 2009 8:11 am

I think the installer files do not work correctly. After fresh installation the database is being populated successfully and I can get access to the frontend of the site. However the database table 'user' remains empty after installation. Therefore I cannot get access to the admin panel.

During installation I have not received any error message. Therefore the step3.php code do not work.
Code: Select all
if (!$errors) {
   mysql_query('set character set utf8', $link);
   mysql_query("delete from user where user_id = '1'");
   mysql_query("insert into `user` set user_id = '1', user_group_id = '1', username = '" . mysql_real_escape_string($_POST['username']) . "', password = '" . mysql_real_escape_string(md5($_POST['password'])) . "', date_added = now()", $link);
   mysql_close($link);
}
 


config.php after installation:
Code: Select all
<?php

define('CONFIG_VERSION', '0.7.9-RC8');
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASSWORD', 'admin');
define('DB_NAME', '798');
define('DIR_BASE', 'C:\\Apache\\server\\798\\');
define('HTTP_BASE', 'http://127.0.0.1/798/');
define('HTTPS_BASE', '');

?>
dad
 
Posts: 39
Joined: Mon May 26, 2008 8:30 pm

Re: [0.7.9RC8] No match for Username and/or Password

Postby hm2k » Thu Jan 29, 2009 10:13 am

If it did not work, you would get an error.
UK Web Hosting
And Gadgets - LIVE and OpenCart powered!

Have we helped you? please donate
User avatar
hm2k
Global Moderator
 
Posts: 583
Joined: Tue Mar 11, 2008 1:06 am
Location: UK

Re: [0.7.9RC8] No match for Username and/or Password

Postby Qphoria » Thu Jan 29, 2009 12:01 pm

dad wrote:During installation I have not received any error message. Therefore the step3.php code do not work.
Code: Select all
if (!$errors) {
   mysql_query('set character set utf8', $link);
   mysql_query("delete from user where user_id = '1'");
   mysql_query("insert into `user` set user_id = '1', user_group_id = '1', username = '" . mysql_real_escape_string($_POST['username']) . "', password = '" . mysql_real_escape_string(md5($_POST['password'])) . "', date_added = now()", $link);
   mysql_close($link);
}
 


I've created a simple debug version of step3.php
Please extract this file into your install folder and run installer again. Please copy and paste all the echo'd messages you see at the top of step3 when installing. Maybe we will figure out where it's having a problem
Last edited by Qphoria on Thu Jan 29, 2009 3:22 pm, edited 1 time in total.
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18208
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: [0.7.9RC8] No match for Username and/or Password

Postby dad » Thu Jan 29, 2009 1:18 pm

Parse error: parse error, expecting `','' or `';'' in C:\Apache\server\798\install\step3.php on line 47

After ; was added at the end of
Code: Select all
echo "link is ok";
,

Parse error: parse error, expecting `','' or `';'' in C:\Apache\server\798\install\step3.php on line 51
....
Parse error: parse error, expecting `','' or `';'' in C:\Apache\server\798\install\step3.php on line 56

.....

'../config.php' was updated successfully.

link is okabout to create adminadmin should be created

Finished!

.....

Congratulations! You have successfully installed OpenCart.

BUT NOTHING WAS CHANGED!
The 'user' db table is empty again and therefore the same message: No match for Username and/or Password :(
Last edited by dad on Thu Jan 29, 2009 1:42 pm, edited 1 time in total.
dad
 
Posts: 39
Joined: Mon May 26, 2008 8:30 pm

Re: [0.7.9RC8] No match for Username and/or Password

Postby dad » Thu Jan 29, 2009 3:03 pm

I changed code in the step3.php:

Code: Select all
if ([color=red]$errors[/color]) {
   if (!$link = @mysql_connect($_POST['db_host'], $_POST['db_user'], $_POST['db_pass'])) {
      $errors[] = 'Could not connect to the database server using the username and password provided.';
        echo 'Could not connect to the database server using the username and password provided.';
   }
   else {
      if (!@mysql_select_db($_POST['db_name'], $link)) {
         $errors[] = 'The database could selected, check you have permissions, and check it exists on the server.';
            echo 'The database could selected, check you have permissions, and check it exists on the server.';
      }
   }
echo 'errors';
}

[color=red]echo 'The database could selected';[/color]


and received following messages:
Code: Select all
'../config.php' was updated successfully.

The database could selected
Notice: Undefined variable: link in C:\Apache\server\798\install\step3.php on line 56

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\Apache\server\798\install\step3.php on line 56

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Apache\server\798\install\step3.php on line 57

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Apache\server\798\install\step3.php on line 57

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Apache\server\798\install\step3.php on line 58

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\Apache\server\798\install\step3.php on line 58

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Apache\server\798\install\step3.php on line 58

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\Apache\server\798\install\step3.php on line 58

Notice: Undefined variable: link in C:\Apache\server\798\install\step3.php on line 58

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\Apache\server\798\install\step3.php on line 58

Notice: Undefined variable: link in C:\Apache\server\798\install\step3.php on line 59

Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in C:\Apache\server\798\install\step3.php on line 59
Last edited by dad on Thu Jan 29, 2009 3:22 pm, edited 1 time in total.
dad
 
Posts: 39
Joined: Mon May 26, 2008 8:30 pm

Re: [0.7.9RC8] No match for Username and/or Password

Postby Qphoria » Thu Jan 29, 2009 3:22 pm

dad wrote:
Parse error: parse error, expecting `','' or `';'' in C:\Apache\server\798\install\step3.php on line 51
....
Parse error: parse error, expecting `','' or `';'' in C:\Apache\server\798\install\step3.php on line 56


Sorry... I shouldn't code so early in the morning.

Try the one attached here. I'm not expecting it to change, I just want to see the messages
Attachments
step3.zip
(1.33 KiB) Downloaded 301 times
Last edited by Qphoria on Thu Jan 29, 2009 3:26 pm, edited 1 time in total.
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18208
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: [0.7.9RC8] No match for Username and/or Password

Postby dad » Thu Jan 29, 2009 5:07 pm

Please see only the messages:

'../config.php' was updated successfully.

link is okabout to create adminadmin should be created Finished!
You MUST delete this install directory!


Make 'config.php' unwritable (chmod go-w).


Make 'admin/config.php' unwritable (chmod go-w).
Congratulations! You have successfully installed OpenCart.
dad
 
Posts: 39
Joined: Mon May 26, 2008 8:30 pm

Re: [0.7.9RC8] No match for Username and/or Password

Postby Qphoria » Thu Jan 29, 2009 5:28 pm

Hmm yea.. that all sounds right. It's at least getting to that section of the code.

Try this one and copy/paste the output again. This one will echo the results of each mysql_query command to see which one (if any) is failing and why.
Attachments
step3.zip
(1.34 KiB) Downloaded 285 times
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18208
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: [0.7.9RC8] No match for Username and/or Password

Postby dad » Thu Jan 29, 2009 5:43 pm

'../config.php' was updated successfully.

about to create adminres1=1res2=1res3=admin should be created Finished!
You MUST delete this install directory!


Make 'config.php' unwritable (chmod go-w).


Make 'admin/config.php' unwritable (chmod go-w).
Congratulations! You have successfully installed OpenCart.


Thank you for your help. The matter will keep till tomorrow.
Good bye!
Last edited by dad on Thu Jan 29, 2009 6:10 pm, edited 1 time in total.
dad
 
Posts: 39
Joined: Mon May 26, 2008 8:30 pm

Re: [0.7.9RC8] No match for Username and/or Password

Postby Qphoria » Thu Jan 29, 2009 6:22 pm

ok...
res1=1 - mysql_query('set character set utf8', $link); - SUCCESS
res2=1 - mysql_query("delete from user where user_id = '1'", $link); - SUCCESS
res3="" - mysql_query("insert into `user` set user_id = '1', user_group_id = '1', username = '" . mysql_real_escape_string($_POST['username']) . "', password = '" . mysql_real_escape_string(md5($_POST['password'])) . "', date_added = now()", $link); - FAIL

So it's choking on that.

Can you enter this manually into your phpmyadmin sql window and execute it:

Code: Select all
insert into `user` set user_id = '1', user_group_id = '1', username = 'admin', password = '21232f297a57a5a743894a0e4a801fc3', date_added = now()


Then try logging in or paste the error if you get one
Last edited by Qphoria on Thu Jan 29, 2009 6:41 pm, edited 1 time in total.
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18208
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: [0.7.9RC8] No match for Username and/or Password

Postby dad » Fri Jan 30, 2009 5:51 am

It was done before. When I copied manually all from installed RC6 'user' database table, I could get access to RC8 admin panel.
dad
 
Posts: 39
Joined: Mon May 26, 2008 8:30 pm

Re: [0.7.9RC8] No match for Username and/or Password

Postby Qphoria » Fri Jan 30, 2009 6:23 am

right but this is the exact translated string from the install file. I want to know if maybe your db is choking on either a certain fancy quote or something else
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18208
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: [0.7.9RC8] No match for Username and/or Password

Postby dad » Fri Jan 30, 2009 6:53 am

I tried to execute your query and received phpmyadmin error message:

#1364 - Field 'ip' doesn't have a default value
INSERT INTO `user`
SET user_id = '1',
user_group_id = '1',
username = 'admin',
PASSWORD = '21232f297a57a5a743894a0e4a801fc3',
date_added = now( )
dad
 
Posts: 39
Joined: Mon May 26, 2008 8:30 pm

Re: [0.7.9RC8] No match for Username and/or Password

Postby Qphoria » Fri Jan 30, 2009 6:57 am

Ah.. that's the issue I think.

http://bugs.mysql.com/bug.php?id=14786
http://bugkill.blogspot.com/2007/06/mys ... fault.html
http://trac.roundcube.net/ticket/1483940

Something to do with mysql strict mode.

Tho the table does have a default set:

Code: Select all
CREATE TABLE IF NOT EXISTS `user` (
  `user_id` int(11) NOT NULL auto_increment,
  `user_group_id` int(11) NOT NULL default '0',
  `username` varchar(20) collate utf8_unicode_ci NOT NULL default '',
  `password` varchar(32) collate utf8_unicode_ci NOT NULL default '',
  `firstname` varchar(32) collate utf8_unicode_ci NOT NULL default '',
  `lastname` varchar(32) collate utf8_unicode_ci NOT NULL default '',
  `email` varchar(96) collate utf8_unicode_ci NOT NULL default '',
  [color=red]`ip` varchar(39) collate utf8_unicode_ci NOT NULL default '',[/color]
  `date_added` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`user_id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


But mysql's always been kinda silly that way.. where you have NOT NULL, but the default is NULL.

Maybe hm2k has an idea. It's not really practical to update every table to have a non-null value. Most sites tell you to run in non-strict mode by editing your ini file and changing:
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
to
sql-mode=""
Last edited by Qphoria on Fri Jan 30, 2009 7:11 am, edited 1 time in total.
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18208
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: [0.7.9RC8] No match for Username and/or Password

Postby dad » Fri Jan 30, 2009 7:09 am

But the MySQL-Front see this field as NULL default.
dad
 
Posts: 39
Joined: Mon May 26, 2008 8:30 pm

Re: [0.7.9RC8] No match for Username and/or Password

Postby Qphoria » Fri Jan 30, 2009 7:12 am

dad wrote:But the MySQL-Front see this field as NULL default.


Right, but the field is set to "NOT NULL" so when it defaults to "NULL" it clashes with itself
Needs to be something like "default '0.0.0.0'"
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18208
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: [0.7.9RC8] No match for Username and/or Password

Postby dad » Fri Jan 30, 2009 7:24 am

Why the same part of code in RC6 do not work in RC8?
I should go, sorry.
Last edited by dad on Fri Jan 30, 2009 7:25 am, edited 1 time in total.
dad
 
Posts: 39
Joined: Mon May 26, 2008 8:30 pm

Re: [0.7.9RC8] No match for Username and/or Password

Postby Qphoria » Fri Jan 30, 2009 7:49 am

Have you tried RC6 lately? does it still work? that piece of code hasn't changed at all during the upgrades. It's the same as it was since 0.7.8
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18208
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Next

Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest

Hosted by Arvixe Web Hosting