mysql create table syntax needs a change

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
DiH
Forum Members
Forum Members
Posts: 14
Joined: Thu Nov 11, 2010 12:30 pm

mysql create table syntax needs a change

Post by DiH »

Hello,

I'm try to install CMSMS 1.8.2 on server with php5.2 and everything that's needed to work is fulfilled. I'm stuck on step 5 because the script cannot create tables in my database. I tried a lot of stuff and I found a solution. In order to create a table on my host I have to use this syntax:

CREATE TABLE user.table_name ...

while CMSMS create it the normal way:

CREATE TABLE able_name ...

Could you tell me which files to change and where to put that addition to make the CMS work? I could add the user manually to stay hard-coded as I will always user the same username. Or, is there any other solution?

Thanks in advance,
DiH
Peciura

Re: mysql create table syntax needs a change

Post by Peciura »

Proper way is to edit "/config.php" like this
$config['db_prefix'] = 'user.cms_';
DiH
Forum Members
Forum Members
Posts: 14
Joined: Thu Nov 11, 2010 12:30 pm

Re: mysql create table syntax needs a change

Post by DiH »

Thank you for your response. But isn't config.php file empty before installation is complete?
DiH
Forum Members
Forum Members
Posts: 14
Joined: Thu Nov 11, 2010 12:30 pm

Re: mysql create table syntax needs a change

Post by DiH »

I modified \install\lib\classes\CMSInstaller.class.php

line 237: $result = $db->Execute('CREATE TABLE user.' . $db_prefix . 'dummyinstall (i int)');
and
line 240: $result = $db->Execute('DROP TABLE user.' . $db_prefix . 'dummyinstall');

but it didn't work either.
Peciura

Re: mysql create table syntax needs a change

Post by Peciura »

There is a field "Table prefix" on 5th installation step. Change value to "user.cms_" and hopefully everything will be ok.
DiH
Forum Members
Forum Members
Posts: 14
Joined: Thu Nov 11, 2010 12:30 pm

Re: mysql create table syntax needs a change

Post by DiH »

I did that, but the script did not let me use dot (.), so I changed the regex in CMSInstaller.class.php, on line 204 to:

Code: Select all

&& !preg_match('/^[a-zA-Z0-9._]+$/', trim($_POST['prefix'])) )
I moved to created tables, but they all fail create...

Creating additional_users table... [failed]
...
Importing sample data...Invalid query: INSERT INTO user.cms_version VALUES (33);

I see no hope.
Last edited by DiH on Fri Nov 12, 2010 1:13 pm, edited 1 time in total.
Peciura

Re: mysql create table syntax needs a change

Post by Peciura »

test it

Code: Select all

&& !preg_match('/^[a-zA-Z0-9\._]+$/', trim($_POST['prefix'])) )
Locked

Return to “[locked] Installation, Setup and Upgrade”