Post by dad » Thu Jan 29, 2009 1:33 am

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
New member

Posts

Joined
Tue May 27, 2008 4:30 am

Post by Qphoria » Thu Jan 29, 2009 2:32 am

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
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by dad » Thu Jan 29, 2009 4:11 pm

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
New member

Posts

Joined
Tue May 27, 2008 4:30 am

Post by hm2k » Thu Jan 29, 2009 6:13 pm

If it did not work, you would get an error.

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK

Post by Qphoria » Thu Jan 29, 2009 8: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 11:22 pm, edited 1 time in total.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by dad » Thu Jan 29, 2009 9: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 9:42 pm, edited 1 time in total.

dad
New member

Posts

Joined
Tue May 27, 2008 4:30 am

Post by dad » Thu Jan 29, 2009 11: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 11:22 pm, edited 1 time in total.

dad
New member

Posts

Joined
Tue May 27, 2008 4:30 am

Post by Qphoria » Thu Jan 29, 2009 11: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
Last edited by Qphoria on Thu Jan 29, 2009 11:26 pm, edited 1 time in total.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by dad » Fri Jan 30, 2009 1:07 am

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
New member

Posts

Joined
Tue May 27, 2008 4:30 am

Post by Qphoria » Fri Jan 30, 2009 1:28 am

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.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by dad » Fri Jan 30, 2009 1:43 am

'../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 Fri Jan 30, 2009 2:10 am, edited 1 time in total.

dad
New member

Posts

Joined
Tue May 27, 2008 4:30 am

Post by Qphoria » Fri Jan 30, 2009 2:22 am

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 Fri Jan 30, 2009 2:41 am, edited 1 time in total.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by dad » Fri Jan 30, 2009 1:51 pm

It was done before. When I copied manually all from installed RC6 'user' database table, I could get access to RC8 admin panel.

dad
New member

Posts

Joined
Tue May 27, 2008 4:30 am

Post by Qphoria » Fri Jan 30, 2009 2:23 pm

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
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by dad » Fri Jan 30, 2009 2:53 pm

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
New member

Posts

Joined
Tue May 27, 2008 4:30 am

Post by Qphoria » Fri Jan 30, 2009 2:57 pm

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 3:11 pm, edited 1 time in total.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by dad » Fri Jan 30, 2009 3:09 pm

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

dad
New member

Posts

Joined
Tue May 27, 2008 4:30 am

Post by Qphoria » Fri Jan 30, 2009 3:12 pm

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
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by dad » Fri Jan 30, 2009 3:24 pm

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 3:25 pm, edited 1 time in total.

dad
New member

Posts

Joined
Tue May 27, 2008 4:30 am

Post by Qphoria » Fri Jan 30, 2009 3:49 pm

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
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 1 guest