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:[email protected]: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
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)
Yeah I don't know why MySQL complains about that. Maybe it should default to tcp protocol when unspecified.
A sample connection string is documented.
The migrate MySQL db driver uses the go-sql-driver/mysql DSN.
Most helpful comment
My bad, finally found out after some trial.