Topic: Error creating Database during installation

Hello there,

I have installed frontaccounting on my server before without any problems at all.  I have had to reinstall simply due to silly mistakes by users.

Surprisingly on attempt to reinstall, actually to a subdomain, I get an error message:

Error: Import error, try to import ../sql/en_US-demo.sql manually via phpMyAdmin


I did import the database from a working installation.  But on attempt to login using the admin details i get sql database error:

DATABASE ERROR : could not get validate user login for admin
error code : 1046
error message : No database selected
sql that failed was : SELECT * FROM 10_users WHERE user_id = 'admin' AND password='a0ea68djopiop5478fvdlfgplpoi09iu89676pfg'


Please advice.

Re: Error creating Database during installation

Hello lurdsammie,
There seems to be a strange table prefix (10_), especielly if you are starting with a fresh installation. If you only have one company, the prefix counter starts with (0_). The file, config_db.php, contains the prefix counter. Check that this is set to 0. Also check that your chart of accounts has a prefix of 0_. Otherwise do a search and replace.
The best thing to do when doing a fresh install is to first create the database, and then run the /install, that way it should be taken care of everything.

/Joe

Re: Error creating Database during installation

Thanks joe for the reply.  I am not too sure where that (10_) came from but I have actually taken the trouble to delete the database, deleted the installation directory and recreated everything from scratch, I even changed the database admin details and tried several times to reinstall FA.

Unfortunately this hasn't helped.

Anymore ideas?

thanks

sammie

Re: Error creating Database during installation

Hi Lurdsammie,
I had a similar problem as you described here. After some fumbling around I figured out that I didn't have enough rights on the database. Please check if you have permission on this database for Creating tables.

Also, try loging into mysql from the command line, if possible. Or, if you have phpmyadmin, select the database and see if you have permissions.

Raja

Re: Error creating Database during installation

Hi all,
I had the same problem when installing FA in subdomain. Strange 10_ prefix is simply result of multiply calling install.php  Database was not created, but you have 10 new login data sets in config_db.php. This bug is the small one.

The reason of the whole issue is unclear for me, and I hadn't enough time to track it down. Database claims that there is syntax error near ';' in line 20 of en_US.sql

Janusz

Re: Error creating Database during installation

Hello again,

I've just  found it.
This is problem of some old MySQL extensions for php which do not like ';' in 'create' queries. This bug affects MySQL client API version 3.23.58 at least. The problem will be fixed in CVS soon.

You can fix it yourself too in your local copy of FA, here is the patch:

diff -r1.5 maintenance_db.inc

163c163
<             if (strtolower(substr($line, 0, 1)) == ")")
---
>             if (strtolower(substr($line, 0, 1)) == ")") {
164a165,166
>                 $line = substr($line,0,strlen($line)-1);
>           }

Regards
Janusz