Create site from template, create separate DB 14 Years, 10 Months ago
|
Karma: 1
|
I created a template. When I look at the template in the template manager list, the columns "From DB" and "From DB Prefix" are blank. See attached "templatelist.png"
|
|
|
Last Edit: 2010/02/13 03:18 By jmsalazarjr.
|
|
Re:Create site from template, create separate DB 14 Years, 10 Months ago
|
Karma: 1
|
All right, I can't upload an image for some reason.
Anyway: I don't know if it's a problem or not, or if you expect those columns to be empty when you look at the template list manager.
Now, the problem I'm having is that I can't create a new database when creating new slave sites from the template.
My slaves are supposed to use the same DB user as the master site, and the template is supposed to create a new DB with the name {site_id}.
The DB user has the privilege to create databases, create users, grant permissions, etc.
If I create the DB manually myself, then creating the slave site from the template will load the new DB with data from the master DB. So there doesn't seem to be any problem with defining the new DB, only with creating it.
However, If I don't create the new DB myself manually, and the JMS script also fails to create it, then I expect to have an error reported to me. That's not what happens. Instead what happens is what I DON'T expect: The JMS script goes ahead and creates the slave site, and just uses the master DB for the slave site. I went to a lot of trouble to figure this out, and wrecked my master DB by making changes in the slave site (connected to master DB without me knowing).
So, please help me with the following:
Why would my DB user, with CREATE privilege, not create the new DB for the new slave site?
Why would JMS not warn me that my preference to create a new DB for the new slave site failed, and why would JMS proceed to perform a completely different execution? A dangerous one? Without telling me?
All right, the second piece there is just a complaint. Now that I know to look for this result, and to confirm it before I proceed to make changes in the slave site, I will survive without wrecking my master DB. The real concern is that I need to get JMS to create the new DB's for new slave sites.
You understand, it's necessary for me to use the jos_ table prefix, that's why I don't just use new tables in the master DB. What MySQL privileges should my DB user have, in order to create the DB according to the JMS script? The user has "CREATE".
Thank you very much
|
|
|
Last Edit: 2010/02/13 03:31 By jmsalazarjr.Reason: spelling
|
|
Re:Create site from template, create separate DB 14 Years, 10 Months ago
|
Karma: 54
|
If you have a problem to create dynamically DB, first check that you have the lastest version of JMS.
Second if you have the laster version, potentially specify the parameters in the root login and password into the "multiistes.cfg.php" file as explained in the user manual page 14.
A key element can also be the "DB host" that you may have to specified in the "multisites.cfg.php" file to ensure that the MySQL user that will be potentially created by JMS or granted will be attached to the correct host name or IP address.
Some environment may use private IP like 192.168.1.xxxx that is not a localhost or 127.0.0.1
If JMS can not create dynamically the DB you should have a MySQL error message that will tell you if this is a user or a DB problem.
You can also use the PHPMyAdmin to check if the DB is created and also to check if the MySQL user have correct privileges.
In general it is advised to use a root login to create the DB and the MySQL user dynamically.
|
|
|
|
|
Re:Create site from template, create separate DB 14 Years, 10 Months ago
|
Karma: 1
|
Thank you, I will use root credentials in cfg.php while I set up my site(s) in a development lab. Since you asked, I'll say that I am using JMS 1.2.20, patches definition 1.2.26. Also Joomla 1.5.15, for the record.
Before moving anything to production, I'm going to want to NOT have root credentials in cfg.php. So, while I think the above is going to allow me to make progress for right now, I wonder if you can help a little more so that I can avoid keeping that cfg.php setting.
In particular:
• "If JMS can not create dynamically the DB you should have a MySQL error message that will tell you if this is a user or a DB problem"
Where will this message appear? It doesn't show up in the admin interface for Multisites, when I run "new site from template". It also doesn't show up in PHP errors log. I want to look for it in order to find out what's going on with my user, can you help with this?
And:
• "You can also use the PHPMyAdmin to check if the DB is created and also to check if the MySQL user have correct privileges."
The DB does not get created. My user as defined in my JMS site template has CREATE. What privilege should the user have in order to create DB as necessary under JMS?
And:
• "A key element can also be the "DB host" that you may have to specified in the "multisites.cfg.php" file to ensure that the MySQL user that will be potentially created by JMS or granted will be attached to the correct host name or IP address."
I'm not going to create new users for each DB. The original user is to be used for master DB as well as for separate DBs in slave sites. This is the user who has CREATE privilege. Is that user missing something?
Thanks again, I appreciated hearing from you on the weekend.
|
|
|
Last Edit: 2010/02/15 02:20 By jmsalazarjr.Reason: indicate version numbers.
|
|
ROOT user also fails to create new DB 14 Years, 10 Months ago
|
Karma: 1
|
I did as you say: put root username and password in multisites.cfg.php
Nothing has changed. The template indicates that a new DB with name of {site_id} should be created, it does not happen. Instead slave site is created using same DB as master site.
So, I must be defining the template wrongly. I wish I could attach images to this forum, I don't know why I cannot. I would show you the screenshot of template settings.
|
|
|
|
|
Re:ROOT user also fails to create new DB 14 Years, 10 Months ago
|
Karma: 1
|
Let's try it this way:
Here are the template details, as seen in the list view in the template manager:
ID: ALU
Group: default
From site id: :master_db:
To site id: {site_id}
To domains : http://{site_id}.mytestdomain.com:9001
From DB: [EMPTY!]] (I asked about this in my first post - is it normal?)
From DB Prefix: [EMPTY!]] (I asked about this in my first post - is it normal?)
To DB: {site_id}
to DB Prefix: jos_
Themes: {site_dir}\multisites\{site_alias}\templates
Here are the template details, as seen in the template's own detail page:
ID: ALU
Group: default
Validity duration: 0
Max nbr of sites / owner: 0
Expiration URL:
Product reference (SKU):
Title:
Description:
List of domain names (*): http://{site_id}.mytestdomain:9001
Replicate the tables from an existing DB prefix into a new tables prefix of a new DB
Template site (*): < Master Site > ( integration, jos_ )
To site ID (*): [site_id}
Admin User (*): - Users -
Share the whole site:
New DB server: localhost
New DB Name: {site_id}
New DB User:
New DB Password:
New DB Prefix (*): jos_
Specific slave site folders
Master site folder: D:\inetpub\integration
Path to Media folder:
Path to Image folder:
Templates (themes) folder:
New FTP Parameters
FTP enable: Default
FTP host:
FTP port:
FTP user:
FTP password:
FTP root path:
(*) Fields required to have the template available from the front-end
Does any of that illustrate to you why even ROOT (forget the original DB user) does not create the new DB?
|
|
|
Last Edit: 2010/02/15 19:56 By jmsalazarjr.Reason: redact company information
|
|
|