A fatal MySQL error...
 
Notifications
Clear all

A fatal MySQL error was encountered. Unable To Install Second Site.

11 Posts
2 Users
0 Reactions
5,677 Views
(@princess-destiny)
Posts: 56
Trusted Member
Topic starter
 

URL to your eFiction:  It's not installed yet.
Version of eFiction:  3.5.3 install.
Have you bridged eFiction, if so with what?: N/A
Version of PHP: 5.2.17
Version of MySQL: 5.5.23-55
Have you searched for your problem: (yes)  I found the same error on other threads, and either they had no response from anyone, or I tried what was suggested and it didn't work.
If so, what terms did you try:  A fatal MySQL error was encountered + tables + installing tables + installing new efiction + Query: CREATE TABLE IF NOT EXISTS
Do you have a test account for us?  No.  It's not installed.
State the nature of your problem:

eFiction 3.5.3 Install
A fatal MySQL error was encountered.
Query: CREATE TABLE IF NOT EXISTS`settingsfanfiction_settings` ( `sitekey` varchar(50) NOT NULL default '1', `sitename` varchar(200) NOT NULL default 'Your Site', `slogan` varchar(200) NOT NULL default 'It''s a cool site!', `url` varchar(200) NOT NULL default ' http://www.yoursite.com', `siteemail` varchar(200) NOT NULL default 'you@yoursite.com', `tableprefix` varchar(50) NOT NULL default '', `skin` varchar(50) NOT NULL default 'default', `hiddenskins` varchar(255) default '', `language` varchar(10) NOT NULL default 'en', `submissionsoff` tinyint(1) NOT NULL default '0', `storiespath` varchar(20) NOT NULL default 'stories', `store` varchar(5) NOT NULL default 'files', `autovalidate` tinyint(1) NOT NULL default '0', `coauthallowed` int(1) NOT NULL default '0', `maxwords` int(11) NOT NULL default '0', `minwords` int(11) NOT NULL default '0', `imageupload` tinyint(1) NOT NULL default '0', `imageheight` int(11) NOT NULL default '200', `imagewidth` int(11) NOT NULL default '200', `roundrobins` tinyint(1) NOT NULL default '0', `allowseries` tinyint(4) NOT NULL default '2', `tinyMCE` tinyint(1) NOT NULL default '0', `allowed_tags` varchar(200) NOT NULL default '

           ', `favorites` tinyint(1) NOT NULL default '0', `multiplecats` tinyint(1) NOT NULL default '0', `newscomments` tinyint(1) NOT NULL default '0', `logging` tinyint(1) NOT NULL default '0', `maintenance` tinyint(1) NOT NULL default '0', `debug` tinyint(1) NOT NULL default '0', `captcha` tinyint(1) NOT NULL default '0', `dateformat` varchar(20) NOT NULL default 'd/m/y', `timeformat` varchar(20) NOT NULL default '- h:i a', `recentdays` tinyint(2) NOT NULL default '7', `displaycolumns` tinyint(1) NOT NULL default '1', `itemsperpage` tinyint(2) NOT NULL default '25', `extendcats` tinyint(1) NOT NULL default '0', `displayindex` tinyint(1) NOT NULL default '0', `defaultsort` tinyint(1) NOT NULL default '0', `displayprofile` tinyint(1) NOT NULL default '0', `linkstyle` tinyint(1) NOT NULL default '0', `linkrange` tinyint(2) NOT NULL default '5', `reviewsallowed` tinyint(1) NOT NULL default '0', `ratings` tinyint(1) NOT NULL default '0', `anonreviews` tinyint(1) NOT NULL default '0', `revdelete` tinyint(1) NOT NULL default '0', `rateonly` tinyint(1) NOT NULL default '0', `pwdsetting` tinyint(1) NOT NULL default '0', `alertson` tinyint(1) NOT NULL default '0', `disablepopups` tinyint(1) NOT NULL default '0', `agestatement` tinyint(1) NOT NULL default '0', `words` text, `version` varchar(10) NOT NULL default '3.5.3', `smtp_host` varchar(200) default NULL, `smtp_username` varchar(50) default NULL, `smtp_password` varchar(50) default NULL, PRIMARY KEY (`sitekey`) ) TYPE=MyISAM;
           Error: ()

_____________________________________________________________________

This is actually the second site I am doing with efiction and someone else helped me install the first one years ago. This new one  is going up under http://www.destinyspublications.com .

Under public_html I created a folder called destinyspublications.com and uploaded the efiction 3.5.3 Install.  I created a database and user name under my cpanel and used the permissions from my other site destinysgateway.com  Database Name: princess_phpbb3 and User Name princess_phpbb3.  Then I created a folder called stories and set it to 777, so the fanfiction can be save to the server there.  Then I moved config.php to the main destinyspublications.com folder from the docs folder and set it to 666.  I then went to the domain name and started the install, creating the Configuration file with the following:

Database Host: ***
Database Name:
***
Database User:
***
Database Password:
***
Site Key
***]
Language: en
Settings Table Prefix:  
******

It correctly goes to the next step, which is:  How do you want to install the settings table? automatic or manual.  Now if I go to automatic, it says A fatal MySQL error was encountered with the full error above.  And if I go to manual, having copied the tables.sql into the main directory and copying the details from my other site into it, it says:  Manually install the settings table from the tables.sql file found in the docs/ folder now.  I click Continue and it goes right back to the How do you want to install the settings table? automatic or manual.

I'm not absolutely certain about the tables.sql, because I couldn't find any doco about how to actually create these, but I thought copying the content of the same file from my other site would work, as I want the same layout.

I even deleted it all and installed version 2.2, getting to step 4 before getting a php error that I couldn't get around, but now I've deleted it all and gone back to installing 3.5.3.

Please, please help me?  I'm setting up a site for author's to post their original novels and short stories and they're all waiting on me.  If you could please tell me what I've done wrong and if the tables.sql isn't right, point me at how to change it.  I note that the errors in the fatal sql message mentions things like My Site and Slogan, but I can't see anything like that in the tables file.

Thank you in advance!

Regards,
Aurelia


 
Posted : 28/05/2012 2:29 am
(@lyndsie)
Posts: 1263
Member Moderator
 

What you posted and your site as it stands are saying that you don't have the right database information.

FIRST: Edit your post. You should not even post any of the database information such as the name and user and your sitekey.

Both of these sites are in the same file directory (the same public_html folder) and are intended to be installed in the same database? When you say you created a new database but are using the information from your old one, it won't work. It sounds like you have a mix of old and new information.

You can install two instances of eFiction in the same database if you like (that's what sitekeys and table prefixes are for), but please clarify which you'd like to do: install it in a new database or all in the same database.

I can address your other queries / problems after that if you like, but one step at a time. : )


 
Posted : 28/05/2012 3:06 am
(@princess-destiny)
Posts: 56
Trusted Member
Topic starter
 

Hi Lyndsie!

Thank you so much for replying.  I spent four or five hours on this last night till early morning, then concluded that I just don't know enough about php and mysql to do a darn thing to help me.

I edited the info.  I figured that the site key would change the next time I tried to install, but I put all that so you could see every step I took and tell me if I did it right or wrong. πŸ™‚

The database for Destiny's Pubications is created new, through the cpanel, where I ticked all the boxes on the permissions but for Create View (This was not ticked on my other site's database).   I copied and pasted the coding from the table.sql of my other site Destiny's Gateway to the new Destiny's Publications table.sql.  Nothing else has been copied from the old site files.  When I go through the brand new installation for the site, it won't do the automatic creation of tables, because it receives an error every time. And I know that it says when you're doing it manually, to alter the table.sql accordingly, but I couldn't find any info on doing that.  Every manual I looked at, or the wiki, just said change table, but not how to do it.  

The new site DP is directly under the html public, in a folder called destinyspublications.com and all the efiction 3.5.3 files and folders are under that. My other site DG had all the efiction folders put directly under public_html, without making a subfolder called Destiny's Gateway, which could be causing some issues.  My friend at the time did it that way.

The main problem that I can see, since the database is brand new and it's giving me that mysql error, is maybe I haven't done the tables.sql right.  I just went to that file for my original site, edited and copy pasted into the new site's file.  I thought it would have the right setup, but apparently that's not right.  The step that makes the config.php file could also be a problem.  I've done that, then moved the file outside of the docs folder, but I've also tried moving it outside the folder first, then adding in the details afterwards.  It produces the error either way.

I intended to find out if there was a way to share the members and authors from my other site to the new one, but not the fanfiction, since the new site will only be original novels and they'll have to upload them fresh.  Other than that, it's a whole different database and site.  I'm doing new skins and the categories and genres, then they can join up and start posting. If there is a way to share the members and authors during the setup, that would be a big bonus but right now I just want to get the script installed and go from there.  O_o

Regards,
Aurelia


 
Posted : 28/05/2012 4:58 am
(@lyndsie)
Posts: 1263
Member Moderator
 

You can have to different eFiction installs sharing the same authors table. Here is the post about it: https://efiction.org/forums/index.php?topic=3286.0.

You still don't have the right information for your database, so that's why the install isn't working. It can't find the database to insert the data. Do you have cPanel? If so I can give more explicit directions. The reason there aren't any instructions on how to update the tables manually is that it's an advanced technique dependent on your web server's setup / your access, which is outside the scope of eFiction. For instance, I might copy and paste the info and run it through PHPMyAdmin; those with SSH or shell access might use a terminal line option. You shouldn't need to do that if you set up the database info right; even if you do a manually install but config.php doesn't contain the right info, the site won't work anyway.

If you would like to share the author's table, it can definitely be done. It's going to be more complicated and will force you to learn a little more about all this stuff than a standard install, so if that sounds good, then here's what you do.

-You can delete the database and user that you created for the new site. Make sure you have on hand the information for the old site's database connection.
-Put the eFiction files in the desired directory. Do not modify anything outside of what it says in the install instructions. (Move and change permissions on config.php; if you're using files for storage, then create the stories folder as specified). Don't touch what's inside config.php. If you're not sure if you've done something already that you shouldn't have, I suggest reuploading the files to be sure.
-Navigate to the site to begin the install process
-When prompted for the database information, enter it. MAKE SURE TO CHOOSE A DIFFERENT SITEKEY! Each install must have a separate sitekey or bad stuff happens. Also ensure that you choose a different prefix for the new site than the old has. (Keep in mind that you can have a different prefix for the settings table than the other tables, so don't let that trick you, you will have 2 times to enter a prefix)
-Follow the rest of the install
-Poke around and test it, but don't let people sign up to the new install.
-Once you've seen that everything works, change the code specified in the post I linked. Note that the top post is for an older version of eFiction, what you want is here: https://efiction.org/forums/index.php?topic=3286.msg37750#msg37750  (At some point script-wide, prefixes were changed from a variable to a contant - it's just a small but important formatting thing). Your new site would be Site B.

If you want your new site to have the same layout, then you can copy over the skins you'd like.

If you run into problems, post back here.


 
Posted : 28/05/2012 2:54 pm
(@princess-destiny)
Posts: 56
Trusted Member
Topic starter
 

Hi Lyndsie,

I followed you instructions and the ones at https://efiction.org/wiki/index.php5?title=Installing_3.0, but I get the same error.  I even uploaded the config.php and tables.sql again so I could start afresh.  I deletedthe database again and made a new one with a different name in cpanel as I did before, which is the exact same way in the instructions and I even modeled it on the database name of site A except I changed the number at the end.  I added a new user and added it to the database, then went in and ticked all of the permissions (Everything with a star next to it has been ticked in the database):

ALL PRIVILEGES

ALTER *
CREATE *
CREATE ROUTINE * 
CREATE TEMPORARY TABLES  *
CREATE VIEW
DELETE  *
DROP  *
EXECUTE  *
INDEX  *
INSERT  *
LOCK TABLES  *
REFERENCES  *
SELECT  *
SHOW VIEW  *
UPDATE *

Config.php has been moved from the data folder to directly under destinyspublications.com (The main efiction folder) and set to 666.  I created a folder under the main called stories and set to 777. 

Then I went to destinyspublications.com and it took me right to the configuration screen.  I added in the database details, had a new key it generated, and left Settings Table Prefix blank (I have also tried putting 'settings' there or even given it name, with the same results).  It says Configuration file written.  Continue.  Then I get the option of Automatic or Manual.  When I select automatic, I get the usual error:

A fatal MySQL error was encountered.
Query: CREATE TABLE IF NOT EXISTS`fanfiction_settings` ( `sitekey` varchar(50) NOT NULL default '1', `sitename` varchar(200) NOT NULL default 'Your Site', `slogan` varchar(200) NOT NULL default 'It''s a cool site!', `url` varchar(200) NOT NULL default ' http://www.yoursite.com', `siteemail` varchar(200) NOT NULL default 'you@yoursite.com', `tableprefix` varchar(50) NOT NULL default '', `skin` varchar(50) NOT NULL default 'default', `hiddenskins` varchar(255) default '', `language` varchar(10) NOT NULL default 'en', `submissionsoff` tinyint(1) NOT NULL default '0', `storiespath` varchar(20) NOT NULL default 'stories', `store` varchar(5) NOT NULL default 'files', `autovalidate` tinyint(1) NOT NULL default '0', `coauthallowed` int(1) NOT NULL default '0', `maxwords` int(11) NOT NULL default '0', `minwords` int(11) NOT NULL default '0', `imageupload` tinyint(1) NOT NULL default '0', `imageheight` int(11) NOT NULL default '200', `imagewidth` int(11) NOT NULL default '200', `roundrobins` tinyint(1) NOT NULL default '0', `allowseries` tinyint(4) NOT NULL default '2', `tinyMCE` tinyint(1) NOT NULL default '0', `allowed_tags` varchar(200) NOT NULL default '

I have absolutely no idea what could be going wrong, since I created the database through the cpanel under MySQL Databases with the same format as my other site, only changing the number at the end.  Have added a brand new user, ticked the permissions and added that user to the database.  I've done it over and over and even deleted all the files and reuploaded then, but got the same error.  It has a new site key every time and I even tried deliberately stuffing up the database details to see if it accepted it, but it rejected them, which means it is accepting the database details, but then goes wrong on step 2.

Regards,
Aurelia


 
Posted : 28/05/2012 11:49 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

I'm not sure that it checks the database connection until step 2 (creating the settings table). Step one probably just writes the info the config.php file, which will be whatever you put in the fields. Based on the message being displayed on the site something is still not set correctly. Perhaps you are missing the prefixes? Re this section of the install guide.

Note the database and user names: Most of the time, your webhost user name is prefixed to the name of the database. When entering your database name and user, enter them just as they are listed on your database page even if that's not exactly how you created them. So for example, say you use the username Bob7 to log in to your cPanel. Then, you create a MySQL database called "stuff" and a MySQL username called "user7". Your database name would most likely be bob7_stuff and your username bob7_user7, and this will be reflected in the list of current databases.


 
Posted : 29/05/2012 12:50 am
(@princess-destiny)
Posts: 56
Trusted Member
Topic starter
 

Yes, the webhost name is bebop (Not real name).  So the new database is Bebop_*******  and it's that for the user name too.  I've copied and pasted the details right from cpanel and even written them in.  If any of the details on that configuration page are wrong, the configuration file gives an error and won't complete.  But it's accepting it and says it's created.  But it won't start an automatic creation of the tables.  I might have to do the manual, but I don't know how to do that.  Is there a manual way to bring up the page that you enter the details into the for site, slogan etc?

You know, I found about four other people on this board with the exact same errors, but nothing was solved for them either.  One other resolved it by installing an old version of efiction, then doing the update, but when I tried that, I got a whole new lot of errors. I know that the script works, because my other site is fine, but this one just won't install.  If I can do the tables manually, I think that will get me past that step.

Lyndsie, if you'd be willing to help me, I can give you the cpanel password and details, so you can see that I've done the database part right. I'd really, really appreciate if you could get this working for me! πŸ™‚  If it's something small I'm missing, then you might spot it.  I've been trying for days and might be just too frustrated and overlooking something.

Regards,
Aurelia


 
Posted : 29/05/2012 1:35 am
(@lyndsie)
Posts: 1263
Member Moderator
 

Hey I just PMed you. : )


 
Posted : 29/05/2012 9:06 pm
(@princess-destiny)
Posts: 56
Trusted Member
Topic starter
 

Lyndsie got the tables done and now I can see the site, but when I go to Admin to add site details, it goes to a page that says:  Are you sure you want to update? You are encouraged to back up your database before proceeding with this operation.  Yes or No.  When I click on no, it just goes back to the main site page and when I click yes, it receives this error:

A fatal MySQL error was encountered.
Query: alter table fanfiction_authorinfo add primary key(uid,field);
Error: ()

I did a search through the forum and I found two other threads with the same error, but they had duplicate entries on the primary key and I don't have that error.  I checked the manual, but nothing there and I also compared the tables.sql with my original site's one, but nothing jumped out as having the wrong structure.  There were no duplicates or anything.  I found the table fanfiction_authorinfo and tried changing this is what is displayed:

-- --------------------------------------------------------

--
-- Table structure for table `fanfiction_authorinfo`
--

CREATE TABLE `fanfiction_authorinfo` (
 `uid` int(11) NOT NULL default '0',
 `field` int(11) NOT NULL default '0',
 `info` varchar(255) NOT NULL default '',
 PRIMARY KEY  (`uid`,`field`),
 KEY `uid` (`uid`)
) TYPE=MyISAM;

-- --------------------------------------------------------

Could someone please help?  If I can get past this part, I think I should be okay to go on with the rest.  The site URL is:   http://www.destinyspublications.com/


 
Posted : 03/06/2012 1:01 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

I emailed you, this problem should be solved. It shouldn't be trying to update anymore. : )


 
Posted : 03/06/2012 4:02 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

To post-mortem this, it seems like the version of MySQL didn't like the TYPE=MyISAM. Since that's the default in most cases, if someone runs into in the future, try removing all cases of it from install.php. You'll want to verify it afterwards. Not sure why it wasn't providing an error message.


 
Posted : 04/06/2012 11:38 pm
Share: