Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

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

Closed
clemlatz opened this issue Feb 17, 2015 · 3 comments
Closed

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

clemlatz opened this issue Feb 17, 2015 · 3 comments

Comments

@clemlatz
Copy link

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
Copy link
Owner

dizda commented Feb 17, 2015

Hi,

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

@clemlatz
Copy link
Author

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
Copy link
Owner

dizda commented Feb 17, 2015

Ok, good :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants