Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: default addr for network 'localhost:3306' unknown #178

Closed
bondhan opened this issue Feb 25, 2019 · 3 comments
Closed

error: default addr for network 'localhost:3306' unknown #178

bondhan opened this issue Feb 25, 2019 · 3 comments

Comments

@bondhan
Copy link

bondhan commented Feb 25, 2019

Hi all,

I tried looking for examples on CLI, but found none, did I miss anything? I tried below in CLI and got erros as follows:

bondhan@optimus:~/Downloads$ migrate -source file://scripts -database mysql://root:password@localhost:3306/texo_ewallet_db down
error: default addr for network 'localhost:3306' unknown

bondhan@optimus:~/Downloads$ migrate -source file://scripts -database mysql://root:password@127.0.01:3306/texo_ewallet_db down
error: default addr for network '127.0.01:3306' unknown

I ping localhost and it is there? Is there anything I missed? thanks.

bondhan@optimus:~/Downloads$ ping localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.073 ms
^C
--- localhost ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.073/0.073/0.073/0.000 ms

@bondhan
Copy link
Author

bondhan commented Feb 25, 2019

My bad, finally found out after some trial.

bondhan@optimus:~/Downloads$ migrate -source "file://migration/scripts" -database "mysql://root@tcp(localhost:3306)/texo_ewallet_db" up
1/u blank (145.529702ms)
2/u test_Migration_190221 (254.30958ms)
3/u insert_data (321.177473ms)
4/u unique_trace_number_m_billing_20190225_1614 (426.656934ms)

@bondhan bondhan closed this as completed Feb 25, 2019
@mcandre
Copy link

mcandre commented Mar 7, 2019

Yeah I don't know why MySQL complains about that. Maybe it should default to tcp protocol when unspecified.

@dhui
Copy link
Member

dhui commented Mar 7, 2019

A sample connection string is documented.
The migrate MySQL db driver uses the go-sql-driver/mysql DSN.

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

No branches or pull requests

3 participants