$db_port for non-standard ports
omega8cc - June 26, 2009 - 20:44
| Project: | Provision |
| Version: | 6.x-0.2 |
| Component: | Code |
| Category: | feature request |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | needs work |
Jump to:
Description
More than one MySQL server on VPS with only one IP requires non-standard ports and it would be nice to have $db_port here - something like this in provision_drupal_settings.tpl.php:
$databases['default']['default'] = array(
'driver' => '<?php print $db_type; ?>',
'database' => '<?php print $db_name; ?>',
'username' => '<?php print $db_user; ?>',
'password' => '<?php print $db_passwd; ?>',
'host' => '<?php print $db_host ?>',
'port' => '<?php print $db_port ?>',
);
$db_url = '<?php print "$db_type://$db_user:$db_passwd@$db_host:$db_port/$db_name"; ?>';
#1
That will not be enough: you'll need to overhaul the frontend (which means the db_server node form and the db_server table schema) so that this can be changed by the user. I'm marking this as minor since it's fairly uncommon to see a mysqld on a different port (why would you do that anyways?).
#2
I had to use MySQL 5.1 on a VPS with stable Debian, so with installed MySQL 5.0.
It was VPS with only one IP and without any chance for second IP (Gandi.net case).
Binding one MySQL to public IP and second to localhost was not an option since
remote replication was used.
Trying to find all places in a code where it should be changed, I have found a few
where $port variable was ready to define and use, but there is more where it is
not used (also in parsing template config.php).
This is not a rocket science issue and of course too specific to be a problem. I had a chance
to better learn some details in provision module.
It seems, for example, when you have MySQL listening on a public IP and not localhost,
but both Aegir and MySQL will be on the same IP, Provision will create users in MySQL
with privileges to access from localhost and not public IP. Kind of bug, it seems,
but will report it when confirm if this still exist in 6.x (had this issue under 5.x)
~Grace
#3
Feel free to provide a patch for this functionality.
(as for the grant issue, the behavior likely didn't change in the d6 upgrade, so may as well open a bug about this if you think it's one)