Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Instalation Error. Please Help


Imperiodocha

Recommended Posts

Hello to all,

 

I have followed step by step instructions in installing oscommerce.

I have created database, named it db1.

Change file permissions

Install

 

Install results say Success, but on top appears:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/**********/public_html/shop/install/includes/functions/database.php on line 39

 

I have reset files permissions as pointed on step by step instructions.

 

When I try to go to both catalogue and admin, for both appears a page that says:

 

1146 - Table '*********_db1.configuration' doesn't exist

 

select configuration_key as cfgKey, configuration_value as cfgValue from configuration

 

[TEP STOP]

 

Can someone please help me?

Thanks

Link to comment
Share on other sites

Using whatever tool you used to create your database, go take a look at that database. Does a table named configuration exist?

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hi Jim,

Thank you for reply.

 

I'm very new at this... I used PhPMyAdmin to create the database, but it has no table on it.

I managed to get how I can create one named configuration as you said, but is asking for Number of fields.

How many are they? I have tried to put 1, but after that it shows a lot of fields to fill, but I dont have a clue abut what to put in there.

Can you please help me again?

 

Thank you so much.

Susana

Link to comment
Share on other sites

The installation script tries to create the database for you. Apparently it failed, probably because it has insufficient privileges. The easiest way to fix this is to add the tables manually. In your osCommerce distribution, find catalog/install/oscommerce.sql. Paste the contents of that file in a SQL window in PHPMyAdmin and click Go. That should create all of the tables, and everything should then work.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hi Jim,

 

Yes, i can see it, right below address book, address format, administrartor, banners, banner history, categories, categories description...

 

I have copy/paste everything in oscommerce.sql.

 

Still

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/*******/public_html/shop/install/includes/functions/database.php on line 39

 

 

:(

 

Thanks

Link to comment
Share on other sites

Hi again Jim,

 

I'm sorry for being such a pain, but I have no idea on how to do that.

Could you please explain, or point me in a direction?

 

Many many thanks again...

 

Susana

Link to comment
Share on other sites

Edit the file using any text editor. Add the text in bold on a line by itself. Upload the file to your server.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hi again, Jim

 

Made it exactly as you said.

Result:

 

Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user '*****'@'localhost' (using password: NO) in /home/*****/public_html/shop/install/includes/functions/database.php on line 29

 

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/*****/public_html/shop/install/includes/functions/database.php on line 29

 

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/*****/public_html/shop/install/includes/functions/database.php on line 35

 

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/*****/public_html/shop/install/includes/functions/database.php on line 35

 

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/*****/public_html/shop/install/includes/functions/database.php on line 35

 

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/*****/public_html/shop/install/includes/functions/database.php on line 35

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/*****/public_html/shop/install/includes/functions/database.php on line 39

 

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/*****/public_html/shop/install/includes/functions/database.php on line 35

 

I guess I will just quit... this is much for me to handle....

But i like oscommerce so much...

 

Thank you again,

 

Susana

Link to comment
Share on other sites

  • 11 months later...

I'm resurrecting an old thread because I have exactly the same problem.

 

Situation is this:

I installed OSCommerce a couple of months ago. Went really smoothly, no problems at all.

 

I installed a Wordpress blog on Saturday, and that's when the trouble started. I'm assuming that there's a vulnerability somewhere in Wordpress that made it possible for my sales site to be entered and hacked.

 

My site got hacked yesterday, and google has flagged it as having malware. I panicked a bit, made sure I have backed up the database, and I always keep my website files locally as well as on the server, so deleted all the files on the server. Stupid, I know, I should have just tracked down the issue and fixed it. However I thought a clean install might not be a bad idea anyway.

 

OK, so having backed up the database on the server, I then delete it. it's fine. I have the database on my hard drive.

 

So, NO files at all in the root or subdirectories of the domain name stored on the server.

 

Clean install time. I unzipped the files to a new folder locally on my hard drive, uploaded them to the server. Checked server internal reference, (it's not localhost). Created a blank database. Created a user, with password. made sure (using mysql query browser, and myphpadmin) that it works (the db exists, the user can access it).

 

Ran the install script. It falls over on step 4, with the following:

 

Warning: mysql_select_db() [function.mysql-select-db.php]: Access denied for user 'ODBC'@'127.0.0.1' (using password: NO) in C:\Domains\ariadnetheweaver.org\wwwroot\install\includes\functions\database.php on line 29

 

Warning: mysql_select_db() [function.mysql-select-db.php]: A link to the server could not be established in C:\Domains\ariadnetheweaver.org\wwwroot\install\includes\functions\database.php on line 29

 

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\Domains\ariadnetheweaver.org\wwwroot\install\includes\functions\database.php on line 35

 

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\Domains\ariadnetheweaver.org\wwwroot\install\includes\functions\database.php on line 35

 

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\Domains\ariadnetheweaver.org\wwwroot\install\includes\functions\database.php on line 35

 

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\Domains\ariadnetheweaver.org\wwwroot\install\includes\functions\database.php on line 35

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Domains\ariadnetheweaver.org\wwwroot\install\includes\functions\database.php on line 39

 

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\Domains\ariadnetheweaver.org\wwwroot\install\includes\functions\database.php on line 35

 

Now, I did find out that it hadn't written the configure files correctly, so I located them and corrected them myself (the relevant part reads:

 

// define our database connection

define('DB_SERVER', '(the equivalent of localhost');

define('DB_SERVER_USERNAME', 'ariadnedatainput');

define('DB_SERVER_PASSWORD', 'like I'm gonna put that here...');

define('DB_DATABASE', 'weavery');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', '');

 

I did this in the configure.php files in the following directories (I installed to root, not to catalog)

 

/includes

/admin/includes

 

 

When I had no luck with this, and could tell that the script had failed to set the database up, I went into phpmyadmin and used the oscommerce.sql database file to create the database.

 

No change, I'm still getting the errors.

 

It's bizarre, I'm doing exactly the same setup as I did two months ago, and it's not working this time. I've basically done a completely fresh install, as I figured I can restore the files once I've got the connection working again.

 

I'm at my wits end, can anyone help me track down the issue please?

Link to comment
Share on other sites

Did you give your database user sufficient privileges? It needs to have read/write privileges for osCommerce to run.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Did you give your database user sufficient privileges? It needs to have read/write privileges for osCommerce to run.

 

Regards

Jim

 

Hi Jim

 

yes, full privileges. I'm intending on being the only one to be able to do this.

 

However, on a more positive note, once I stopped trying to refresh the darned page, and just typed in /(mysite)/index.php, the default page loaded, with the default products on it.

 

So, good news, although I still don't know what I did different with this installation :)

 

Just got to restore my old database, and restore the unhacked pages as I had done quite a few modifications (product extra fields, etc).

 

Thanks for responding :)

 

sarah

Link to comment
Share on other sites

Thanks Jim.

 

I already maintain offline copies of the site, which is why I was a bit premature in deciding to reinstall everything. The link you gave was very useful, and I'll add in the security mods too.

 

I do have a problem that even in the cpanel of my webhost, I can't change permissions on files. it's a windows based server, and I read somewhere (!) that it may not be possible. Certainly couldn't change them locally and upload the changed files, as they all reverted to default as soon as they hit the server.

 

That post is worth stickying - I hadn't seen it before.

 

Cheers

 

Sarah

Link to comment
Share on other sites

argh, darnit, I spoke too soon.

 

had to change the configuration file yet again, and it's not allowing me to access the admin panel..

 

Warning: session_start() [function.session-start.php]: open(/tmp\sess_aff072ddfa60b7aa9f20c8640abc9ce1, O_RDWR) failed: No such file or directory (2) in C:\Domains\ariadnetheweaver.org\wwwroot\admin\includes\functions\sessions.php on line 102

 

 

now, there *is* a /tmp directory in the root of the installation, that's what I believed would solve this issue, but it doesn't seem to have done.

Link to comment
Share on other sites

Common problem. Remove the SID from the admin URL, or clear your cookies and try again. Then set Configuration > Session > Temp file to tmp. If you can't get in, use your database admin and change the configuration table by hand.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

ok, this is where I look ignorant.

 

I've cleared my cookies. Logged into the database, located the line in the configuration table called "session directory", changed the configuration_value cell to "tmp" (without the "") and it's not changed a thing.

 

I'm not sure what you mean by "Remove the SID from the admin URL".. sorry!

Link to comment
Share on other sites

and I've now probably done something stupid. checked the administrator table in the db, and saw a random string of letters etc so changed it to what I knew I'd set the password to.

 

As it's now coming up with an error saying "Error Error: Invalid administrator login attempt." I take it that the password was correct, just disguised.

 

it's not the real database anyway, just the default one, so probably not a fatal error.

 

### ignore this problem, restored the proper database, and I'm recognised as admin again, but still can't do the session things so can't log in ###

 

going to reboot the computer in case something silly hasn't cleared. often seems to work ..

Link to comment
Share on other sites

The SID is that long string of characters at the end of the URL. It's not always there, so don't worry if it doesn't show up. If it does, edit the URL by hand so it only shows like this: http://www.example.com/admin/.

 

If you edited the configuration table by hand, you may not have the right location. tmp shows up twice. Make certain that you have changed them both.

 

Also, in your configure.php files (both of them) change the last line to this:

  define('STORE_SESSIONS', 'mysql');

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

ok, that makes sense. I didn't have the string of characters at the end of the URL, so couldn't see it :)

 

I will check the table and adjust the configure files.

 

Thanks again for your help. (fingers crossed)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...