[Camps-users] [Camps-commits] [SCM] Camps development environments branch, master, updated. d09a96a609343a4789f494e99f660622ad7b7249

Ron Phipps ron at endpoint.com
Tue Mar 17 00:25:53 UTC 2009


Jon Jensen wrote:
> This is an automated email from the git hooks/post-receive script. It was
> generated because a ref change was pushed to the repository containing
> the project "Camps development environments".
> 
> The branch, master has been updated
>        via  d09a96a609343a4789f494e99f660622ad7b7249 (commit)
>       from  3b5ed3a1faa7d4dabcfad49a47e22e84ab64a04c (commit)
> 
> Those revisions listed above that are new to this repository have
> not appeared on any other notification email; so we list those
> revisions in full, below.
> 
> - Log -----------------------------------------------------------------
> commit d09a96a609343a4789f494e99f660622ad7b7249
> Author: Jon Jensen <jon at endpoint.com>
> Date:   Tue Feb 24 15:18:41 2009 -0700
> 
>     Fix connection to MySQL database before default user & database have been created.
>     
>     Thanks to Adam Vollrath <adam at endpoint.com> for pointing out the user
>     part of this. This invocation is now like others in Camp::Master that
>     ignore custom user and database settings when they may not yet exist.
> 
> -----------------------------------------------------------------------
> 
> Summary of changes:
>  lib/Camp/Master.pm |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/lib/Camp/Master.pm b/lib/Camp/Master.pm
> index deb25eb..1a31203 100644
> --- a/lib/Camp/Master.pm
> +++ b/lib/Camp/Master.pm
> @@ -2338,7 +2338,7 @@ sub _import_db_cmd_pg {
>  
>  sub _import_db_cmd_mysql {
>      my ($script, $conf) = @_;
> -    return 'mysql ' . camp_mysql_options() . " < $script";
> +    return 'mysql ' . camp_mysql_options( user => 'root', no_database => 1 ) . " < $script";
>  }
>  
>  sub prepare_database {
> 
> 
> hooks/post-receive
> --
> Camps development environments
> _______________________________________________
> Camps-commits mailing list
> Camps-commits at endpoint.com
> https://mail.endcrypt.com/mailman/listinfo/camps-commits

Hi Jon,

I'm working on migrating a client to a new server and as part of the 
process I'm upgrading their camps library as well.  The issue I'm 
running into is when running mkcamp the database is created, the roles 
are created, but when the database is being imported I receive the 
following error:

Processing script 'mysql/tmp/frozencpu.sql':
mysql -u root -p6nob83gu --socket=/home/ron/camp1/mysql/tmp/mysql.1.sock 
< /home/camp/frozencpu/mysql/tmp/frozencpu.sql
ERROR 1046 (3D000) at line 12: No database selected
Error importing data

The problem is the patch above sets no_database => 1 which doesn't allow 
the db_default_database to be used when importing the production dump.

Here is the relevant section to the local-config:

db_dbnames:frozencpu
db_mysql_scripts:mysql/tmp/frozencpu_init.sql
db_source_scripts:mysql/tmp/frozencpu.sql
db_default_database:frozencpu
db_default_user:root
db_sleep_time:15

frozencpu_init.sql contains:

CREATE DATABASE frozencpu;

frozencpu.sql is the production dump.

 From my understanding this is the correct way to do a mysql based app. 
  The extra init script is needed because mysqldump does not include a 
create database statement or a connect to the database.

I'm not sure of the situation you ran into which requires no_database => 
1 so I cannot not submit a patch that works for both cases.  If you have 
a scenario you'd like me to test I can work on a patch that works for 
both scenarios.  For the time being I have removed the no database option.

Thanks,

-- 
Ron Phipps
End Point Corporation
ron at endpoint.com



More information about the Camps-users mailing list