Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install - table PH7_Settings doesn't exist #30

Closed
KeithBronstrup opened this issue Dec 21, 2014 · 29 comments
Closed

Cannot install - table PH7_Settings doesn't exist #30

KeithBronstrup opened this issue Dec 21, 2014 · 29 comments

Comments

@KeithBronstrup
Copy link

Created a new database and user with all permissions on that database, and I do get tables created:

mysql> show tables;
+---------------------+
| Tables_in_ph7       |
+---------------------+
| PH7_Admins          |
| PH7_Games           |
| PH7_GamesCategories |
| PH7_Memberships     |
+---------------------+
4 rows in set (0.00 sec)

Apparently, just not all of them...

I get to step 5 in the installation and I get:

Error connecting to your database.
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ph7.PH7_Settings' doesn't exist

Of course, that means I can't continue installation. Any help?

@pH-7
Copy link
Member

pH-7 commented Dec 23, 2014

  1. This is not a bug. The problem is from you.
    You have to make a new installation. That's not normal! Please download the latest stable version here: http://sourceforge.net/projects/ph7socialdating/files/latest/download

P.S. You have to install the CMS through the automatic installer.

@KeithBronstrup
Copy link
Author

Should I not be able to install from the master branch of this repo?

@pH7Software
Copy link
Collaborator

No because some folders does't exist.

@KeithBronstrup
Copy link
Author

** this reply was posted prior to you editing your reply

I was trying to install from the current state of this repo (not my fork) as of the time I opened this issue. Fresh install of Ubuntu Server.

@pH7Software
Copy link
Collaborator

Normally people are able to install correctly pH7CMS from Github but sometimes you have to quibble...

@pH7Software
Copy link
Collaborator

Please check the SQL tables you should have trhough these SQL files https://github.com/KeMBro2012/pH7-Social-Dating-CMS/tree/master/public/_install/data/sql/MySQL

@KeithBronstrup
Copy link
Author

trying the zip now, will report back

@KeithBronstrup
Copy link
Author

Same result with the zip. Any chance you can test a fresh install on a brand new filesystem and database (which is what I'm doing here) with the current code?

@pH7Software
Copy link
Collaborator

In the install file, check any error file in /_install/data/logs/

@KeithBronstrup
Copy link
Author

Okay so I looked at the tables I have and the tables created by the .sql files on the _install/data/sql/MySQL directory and noticed it was only creating the first two tables in ph7_Core.sql, so I tried importing that manually and got ERROR 1265 (01000) at line 62: Data truncated for column 'enable' at row 2

That's the INSERT statement for pH7_Memberships.

@KeithBronstrup
Copy link
Author

I have an empty /_install/data/logs/keep file, no other files there

@KeithBronstrup
Copy link
Author

It appears that the 'enable' field is defined as an ENUM with strings '1' or '0' as valid values, but the INSERT attempts to set them as integer 1 or 0. gonna change the ENUM values and try again.

@pH7Software
Copy link
Collaborator

It's a problem with your SQL configuration. Not the software at all. Which version do you use, etc?
You should change some configuration, parameters with it. I have a basic configuration and I never had that.

Recommend host with correct SQL configuration: http://ph7cms.com/doc/en/hosting

@KeithBronstrup
Copy link
Author

That didn't work (I forgot ENUM values must be strings), but changing the values in the INSERT to strings did work. Same error occurs for pH7_Members and, likely, anywhere else an integer is being inserted into an ENUM field. Admittedly, this strict type checking is a relatively new feature in MySQL; I've seen this before on MySQL 5.6, but not on MySQL 5.5

@KeithBronstrup
Copy link
Author

No, this is a problem with the application.

Per the MySQL documentation (http://dev.mysql.com/doc/refman/5.0/en/enum.html): "If strict SQL mode is enabled, attempts to insert invalid ENUM values result in an error." And rightly, they should, as it is an error condition. Unlike PHP, MySQL does not implement loose typing and has to be coerced into thinking "1" and 1 are the same value.

The valid values for the ENUM fields exhibiting this issue are "1" and "0" (string values), but your SQL is attempting to insert 1 and 0 (integer values). While this can be made to work, it is incorrect, a potential source of bugs, and should be fixed.

@pH7Software
Copy link
Collaborator

Yes, indeed, it should be "strict" for it. We will resolve that for all ENUM in the next version

@KeithBronstrup
Copy link
Author

Disabling Strict SQL mode allows the installation to continue. That should not be necessary, as Strict SQL mode enforces best practices. The code should be corrected, or you're going to see a lot more instances of this issue as more people start using more-recent versions of MySQL; as of 5.6, Strict SQL mode is enabled and Engine Substitution is disabled (I tripped over that one for a while when I first upgraded).

@KeithBronstrup
Copy link
Author

Okay, glad we're on the same page.

@KeithBronstrup
Copy link
Author

Got a successful install with Strict SQL off. Thanks for the help :)

@pH7Software
Copy link
Collaborator

I totally agree with you. It was a mistake. As you can see in the other tables of the SQL file, ENUM number is always string (e.g., pH7_Ads).

For the next version, I will test that with strict mode.

pH7Software pushed a commit that referenced this issue Dec 23, 2014
@pH7Software pH7Software added bug and removed invalid labels Dec 23, 2014
@pH7Software
Copy link
Collaborator

I haven't test yet, but if you want you can try a fresh installation by replacing the pH7_Core.sql file by https://raw.githubusercontent.com/pH7Software/pH7-Social-Dating-CMS/46f7be900a4334e38a3dcb10cdf3feb281add893/_install/data/sql/MySQL/pH7_Core.sql

@KeithBronstrup
Copy link
Author

I've got my designer and cofounder reviewing it at the moment, but I'll certainly give it a shot on my next reinstall... this is just a development instance at the moment, for testing

@hostile123
Copy link

Error connecting to your database.
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dating.PH7_Settings' doesn't exist

@monadx23
Copy link

This is still an issue with the 6.0.9 release. Turning MySQL strict mode off allows installation to complete but it shouldn't be necessary to do so.

@pH-7 pH-7 reopened this Apr 13, 2017
@pH-7
Copy link
Member

pH-7 commented Apr 13, 2017

@pH-7 pH-7 added the sql label Apr 13, 2017
@pH-7
Copy link
Member

pH-7 commented Apr 14, 2017

@chrisdpucci Please let me know as soon as you can do it, since I am not able to reproduce it on my machine with strict mode. I really need the error from your mysql interpreter so I will be able to fix it.

Thanks

@pH-7
Copy link
Member

pH-7 commented Apr 17, 2017

@chrisdpucci Please let me know if you figured out doing what I said?

@pH-7
Copy link
Member

pH-7 commented Apr 17, 2017

@chrisdpucci Sorry for being that annoying with my comments.. Just wanted to let you that the problem is now fixed: 4bb8aa7#diff-1b88df76554e8b5c9f766a632d5cd3ba

@pH-7 pH-7 closed this as completed Apr 17, 2017
@lock
Copy link

lock bot commented Nov 21, 2018

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

@lock lock bot locked as resolved and limited conversation to collaborators Nov 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants