Full message: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'masterstroke.variable' doesn't exist.
This displays at the 2nd site install on Database Setup (browser > http://subdirsite1/install.php). masterstroke is DB 127.0.0.1:3306
My Config:
- Windows Server 2012 r2 on local switched connection
- Apache2.4 64bit running as service (C:\Apache24)
- MySQL56 64bit running as service (w/ Workbench6.3 - Not phpMyAdmin)
- PHP 64bit threadsafe
- Drupal 7.38 (D:\htdocs\sites\subdirsite1)
I've read dozens of posts/comments on messages resembling this but are different and not applicable or the solution doesn't work. If I could get beyond this I'm pretty certain I would have this install licked so If anyone has an answer to above I would be very grateful.
I have the default Drupal site running with the localhost:3306 database. I created a second DB 127.0.0.1:3306 for the subdirsite1 install and both are connected and configurable in Workbench (C:\ProgramData\MySQL\MySQL Server 5.6\data\masterstroke). Is there something I need to have in the 2nd DB that I didn't need in the first one?
NOTE:
I seem to be having a problem with getting my replies posted and have requested a 'confirmed' user role so please be patient. Thanks!
Comments
=-=
have you worked through: https://www.drupal.org/documentation/install/multi-site
It makes sense that the tables aren't found as they wouldn't yet been installed (assuming you've not yet run install.php).
Is the settings.php file for the subsite a virgin file from a copy of default.settings.php?
Thanks VMII. Please feel free
Thanks VMII. Please feel free to correct me on any of this...
Yes, this was my initial spot when I couldn't get the second (subdirsite1) site to initiate install at all. I solved that by adding entries to the hostfile but the symlink stuff put me off as i thought that was referring to Linux installs. Am I wrong?
I thought of this so I copied tables from the first DB (localhost) and populated masterstroke DB. This didn't make any difference but I left them in there until I could think of something better.
Seeing this was a problem for some, I copied the original default.settings.php into the root of subdirsite1, removing the default. as advised.
Sub-directory Multi-site install DB error
Hints
... and there look e.g. at Multi-site on XAMPP for Windows (https://www.drupal.org/node/1682040).
I know, that you don't use XAMPP, but the steps are the same!
Did you realy build two databases? Look at the web interface of your database server. Give them different names like in my link!
Hint: localhost and 127.0.0.1 are the same webserver and link to the same database-server.
Wusel
Reply to DB Error Multi-site Install
I put this reply in over 7hrs ago and it still hasn't been posted so I'm trying again.
Thanks VMII. Please feel free to correct me on any of this...
Yes, this was my initial spot when I couldn't get the second (subdirsite1) site to initiate install at all. I solved that by adding entries to the hostfile but the symlink stuff put me off as i thought that was referring to Linux installs. Am I wrong?
I thought of this so I copied tables from the first DB (localhost) and populated masterstroke DB. This didn't make any difference but I left them in there until I could think of something better.
Seeing this was a problem for some, I copied the original default.settings.php into the root of subdirsite1, removing the default. as advised.
Hint again
Follow the steps in my link, only change your paths. Then you get it running!
Good luck!
Wusel
Follow the steps in my link
I had followed these steps previously which got me from a no show 404 on my second site to the install loading (over the moon at this point so THANKS!) See https://www.drupal.org/node/2313871#comment-10147168
But when I uncommented the httpd-vhosts.conf line in httpd.conf the install would fail and I would have to put in a fresh settings.php and start again.
Could there be something wrong with my httpd-vhosts.conf?
You need your second doman at httpd-vhosts.conf
You need to add the second ServerName within your file
httpd-vhosts.conflikeIt is one of my steps. Did you follow the other steps completely???
Hint:
Everywhere where I have listed both sites or both registrations all steps must be carried out completely, as well as previously listed under step 3 in my link.
Good luck!
Wusel
You need your second doman at httpd-vhosts.conf
I went through each of your steps carefully, changing what was needed to get the sites to resolve correctly. I removed the 2nd sub-directory site (subdirsite2) to make troubleshooting easier as it didn't make any difference to solving the problem. I added it back just to be sure but there was no change.
New httpd-vhosts.conf
and new hosts file
As one would expect I can browse to the install script with each of the above 4 urls above (suffixed with :8080 of course) but what bothers me is the fact that Apache fails to start whenever I uncomment Include conf/extra/httpd-vhosts.conf in httpd.conf (your step #2). Secondly, it is the database setup the install always fails on. I have even tried to use the original localhost DB that I used with the default site (which works perfectly with the default site BTW). It seems to me this is an issue with the database and Drupal not communicating for the sub-directory sites only.
I thought about reinstalling MySQL but I'm not optimistic as the DBs seem to be running fine. Is there some element/script that interfaces directly between Drupal and MySQL, etc. I should be looking at?
Next hint...
I can not see, where I have said that e.g.
ServerAlias www.subdirsite2:8080is correct.
I think, my code looks more like
ServerAlias www.subdirsite2without any ":8080" in that line!
You have made this error more than once!
And you have more errors in your config file. But that is not drupal...
ToDo:
Please set up a new dev website on that server and follow my ToDo-List "step for step" without any changes.
If that runs, you can change ONE item. Only ONE item, check what happens, change ONE item, check... and so on...
Hint:
You should check your config files to be ok by asking your webserver. Look at the docs of your webserver Apache in the internet (e.g. at http://httpd.apache.org/docs/)...
For XAMPP on windows you will find:
C:\xampp\apache\bin\httpd.exe -tWusel
Apache set to listen on port 8080
Apache is setup to listen on 8080. If I remove the port designation (:8080) the named urls (localhost, subdirsite1, subdirsite2 will not resolve and the install page will not load as I have experienced. I have IIS running on port 80 (for non-Drupal static sites) so port 8080 on Apache is necessary to avoid the port conflict, No? I could swap the ports around so IIS is on 8080 instead. Will give a try.
(I have to set up this dev sever exactly the way I will need to set up the production server to avoid live issues which would be catastrophic for our commerce sites.)
Next hint...
OK, using your config, I setup dummy-host.localhost and dummy-host2.localhost sites, both DBs were created as dummyhost & dummyhost2 with connection tested, updating the other files (host, and httpd-vhosts.conf as follows:
Both urls wouldn't resolve until I put the following into the httpd.conf file:
But that only created a different issue with the same 'localhost default site' loading at www.dummy-host.localhost and http://www.dummy-host2.localhost. Do I now try to resolve this issue or go back to the previous setup?
UDATE:
After deleting MY added lines above to httpd.conf, and dumping mem cache, I copied the default.settings.php file to the each dummysite and renaming to settings.php, the install script loaded for both sites but, again, failed on 'setup database' bit with a similar message to the top of this post:
I don't know, why you didn't follow...
You did not follow!
Are you missing the file
.htaccessor the needed Apache 'mod_rewrite' extension or the running of the file.htaccess?=> Don't change a "running team", until you know, why you have to do this!
Did you ever read the Installation Guide (https://drupal.org/documentation/install) and its linked pages complete and careful, before you start your post at the top of this page?
You delete the settings of that website, if you delete any of the files
settings.php! Why do you delete such a file?Are you knowing, how to setup and install a normal website with Drupal 7? I can not believe this...
My very last hint:
So learn first how Drupal works on a single website installation on your server and then go on with the topic of your first post on this page!
Wusel
Multi-site Issue Resolved at Last!
As suspected the title error message DID have to do with a database flaw (most likely mine) and not so much with the php scripts.
I created all the site databases in Workbench, tested the connections, etc. so I thought all was well until today when I decided to cross check them with mysql monitor CL. On a 'show databases' I found only one of the databases I created was actually listed (the very first test DB which wouldn't connect anyway) but all others not there. So, I created them again, this time with monitor; back in Workbench I tested/saved the DB connections, rebooted apache, refreshed the test url in browser, install script loaded and at the crucial 'setup Database' bit... it took awhile but was relieved when it finally kicked into Initializing.
I don't know what happened to the databases I created in Workbench but at this point I don't care so long as I now have a method to add sites to a single Drupal core:-)
Retrospect
Look at my very first post:
No comment needed!
Wusel
Thanks for question! I got
Thanks for question! I got same problem.