pH7Software / pH7-Social-Dating-CMS

😻 pH7Builder (formerly pH7CMS) is a Professional & Open Source Social Dating CMS written in PHP 8 🚀 This Social Dating Script aims to be low resource-intensive, powerful and secure. pH7Builder includes over 40 modules. It is the first Professional, Free & Open Source Social Dating Site Builder Software and the first choice for enterprise level Da
https://pH7Builder.com
MIT License
965 stars 579 forks source link

Install Issue Duplicate entry #155

Closed Monknot closed 6 years ago

Monknot commented 6 years ago

I am at step 4/8 and when I hit submit I get this error. Error connecting to your database. SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY' I am also incredibly new at this so I may of missed something obvious.

pH-7 commented 6 years ago

Hi @Monknot

Are you sure you install pH7CMS on a new fresh database?

If the problem persists, can you create a new database through your phpmyadmin and run the following files (in the same order)

And let me know if you see any errors from there.

Thanks

Monknot commented 6 years ago

Second one created this error.

CREATE TABLE IF NOT EXISTS pH7_AdminsLogSess ( profileId tinyint(3) unsigned DEFAULT NULL, username varchar(40) DEFAULT NULL, password varchar(240) DEFAULT NULL, email varchar(120) DEFAULT NULL, firstName varchar(50) DEFAULT NULL, lastName varchar(50) DEFAULT NULL, sessionHash varchar(40) NOT NULL, idHash char(32) NOT NULL, lastActivity int(10) unsigned NOT NULL, location varchar(255) DEFAULT NULL, ip varchar(45) NOT NULL DEFAULT '127.0.0.1', userAgent varchar(100) NOT NULL, guest smallint(4) unsigned NOT NULL DEFAULT 1, dateTime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY profileId (profileId), FOREIGN KEY (profileId) REFERENCES pH7_Admins(profileId), KEY sessionHash (sessionHash), KEY lastActivity (lastActivity) ) ENGINE=InnoDB DEFAULT CHARSET=utf8

MySQL said: Documentation

1171 - All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead

pH-7 commented 6 years ago

Thanks @Monknot . I published a patch https://github.com/pH7Software/pH7-Social-Dating-CMS/commit/aa9128ee751e24a649b433bd01b1cde9362ee02d#diff-1b88df76554e8b5c9f766a632d5cd3ba

Can you remove your database and create a new one and do the same again with these new updated files

Monknot commented 6 years ago

First result.

"# MySQL returned an empty result set (i.e. zero rows)."

Second result.

"# 2 rows affected."

Monknot commented 6 years ago

I also get the same error at the same place in the install.

pH-7 commented 6 years ago

So, now it works by uploading the both SQL files manually through PHPMyAdmin (without errors?) but when you go the pH7CMS installer, it doesn't work. Is that right? Please confirm @Monknot

Monknot commented 6 years ago

Correct.

pH-7 commented 6 years ago

Thanks. Are you sure you installed pH7CMS with a new database (empty one) for installing pH7CMS (to make sure you won't get duplicate entries)

Monknot commented 6 years ago

In phpMyAdmin I typed in a new name (Several different names and times just to make sure) and hit create. I than put the name of that new database in the database field on the forum when filling it out.

Monknot commented 6 years ago

I am also wondering should I tag you in my responses like you do me? I am new to GitHub and tickets so I am unsure about proper etiquette.

pH-7 commented 6 years ago

No need to tag me ;) Thanks for those details. In order to reproduce the error, could you tell me if you tried to install pH7CMS on a local host (MAMP, XAMPP, WAMP, ...?) or with a sharing web hosting. If so, what's the name?

Once I have the details of your environment, I will try to install pH7CMS with the same web environment.

Thanks

Monknot commented 6 years ago

I installed it on my Linux laptop and I placed it in my /home/var/www/html folder. I setup a LAMP environment. I am not using anything other than LAMP. I have the required mods for Apache as well.

pH-7 commented 6 years ago

Could you tell me your MySQL version you are using? I will try to setup on LAMP env on my linux machine.

P.S. If you don't use MySQL strict mode, it should work.

Monknot commented 6 years ago

Server version: 5.7.20-0ubuntu0.16.04.1 - (Ubuntu)

pH-7 commented 6 years ago

Hi again!

Alright, I installed it again with latest versions (and with Ubuntu 16 BTW like you mentioned). With PHP 7.2 and with MySQL 5.7.2 and the installer went fine. Everything was OK for me.

Unfortunately, I couldn't reproduce any of your issues.

Please use another host if the error persists. And make a new installation from the code of this Github repo (not from Sourceforce like I said above, I published a patch concerning the primary key).

Monknot commented 6 years ago

OK I will try updating and see what happens. Thank you for your time and effort.

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Thanks, Pierre-Henry