Skip to content

Misuse of shell builtins : mysqldump: Got error: 2004: "Can't create TCP/IP socket" #11

Open
@maab16

Description

@maab16

Sometimes you may face an issue that database backup and restore works fine on command line php artisan dbm:backup but not works in Artisan::call('dbm:backup'). It's happend because mysql dumper artisan command needs to call from localhost. Try this solution.

Maybe you are running your project outside htdocs (xampp) or www(wamp) or running php artisan:serve (127.0.0.1:8000).

Try localhost

OR

Try to setup like this in your apache virtual host. I'm using xampp in windows 10. Here is my setup

Step 1: Open your domain in your hosts file. In my case C:\Windows\System32\drivers\etc\hosts

Add below line in the end of file.

127.0.0.1	yourdomain.com

Save the file.

Step 2: Setup virtual host to link your domain with your project.

<VirtualHost *:80>
    ServerName yourdomain.com
    DocumentRoot C:\xampp\htdocs\project-folder\public
 
    SetEnv APPLICATION_ENV "development"
 
    <Directory C:\xampp\htdocs\project-folder\public>
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

Change 'yourdomain.com' to your original domain and 'project-folder' to your own project folder.

Restart your server. Done!

If you still face the same issue then reply with details.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions