dizda / CloudBackupBundle

Be able to backup your database(s) and upload it to the cloud (Dropbox, Amazon S3, GoogleDrive, etc.)
MIT License
196 stars 57 forks source link

Can't connect to local MySQL server through socket #52

Closed clemlatz closed 9 years ago

clemlatz commented 9 years ago

I'm trying to configure CloudBackupBundle to work in my developpement environnement (MAMP Pro). But when I try php app/console dizda:backup:start I get the following error :

[RuntimeException]
Warning: Using a password on the command line interface can be insecure.
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) when trying to connect

Other console commands using mysql like php app/console doctrine:schema:update are working fine. Am I doing something wrong here ?

Here is my config.yml

dizda_cloud_backup:
    # By default backup files will have your servers hostname as prefix
    # such as: hostname_2014-01-01_21-08-39.tar
    output_file_prefix: ~
    timeout: 300
    error_notification:
        from: test@example.com
        to: [ test@example.com ]
    processor:
        type: tar # Required: tar|zip|7z
    folders: [ web/uploads ]
    cloud_storages:
        # Dropbox account credentials (use parameters in config.yml and store real values in prameters.yml)
        dropbox:
            user:     me@example.com # Required
            password: password  # Required
            remote_path: "/" # Not required, default "/", but you can use path like "/Accounts/backups/"

    databases:
        mysql:
            db_host:     "%database_host%"
            db_port:     "%database_port%"
            database:   "%database_name%"
            db_user:     "%database_user%"
            db_password: "%database_password%"

And my parameters.yml :

parameters:
    database_driver: pdo_mysql
    database_host: localhost
    database_port: null
    database_name: draftquest
    database_user: root
    database_password: pass
dizda commented 9 years ago

Hi,

You don't have any database_password in your parameters.yml ?

clemlatz commented 9 years ago

Yes I have, I just forgot to put it in my message, sorry.

Anyway I changed database_host from localhost to 127.0.0.1 and now it works, but I still can't figure out why it wouldn't pick the correct socket, though. Anyway it's working now, thanks.

dizda commented 9 years ago

Ok, good :)