Does the user 'root' have the permission to access the database on the MySQL server running on 'localhost'?
Note that this is not a Go problem but a MySQL problem. You should try to access the database using the mysql command line client berfore using it in an application. Lutz ________________________________________ Von: golang-nuts@googlegroups.com <golang-nuts@googlegroups.com> im Auftrag von Sarchcheelanbca Bala <sarchcheela...@gmail.com> Gesendet: Freitag, 11. Oktober 2019 13:49 An: golang-nuts Betreff: [go-nuts] Not able to connect with mysql database Hi Team am not able to connect my go program with mysql. Getting the below error. I have attached main.go file for your reference 2019/10/11 17:11:42 http: panic serving [::1]:59577: Error 1045: Access denied for user 'root'@'localhost' (using password: YES) goroutine 74 [running]: net/http.(*conn).serve.func1(0xc00004ae60) c:/go/src/net/http/server.go:1767 +0x140 panic(0x771740, 0xc0000ce400) c:/go/src/runtime/panic.go:679 +0x1c0 main.Index(0x8828a0, 0xc000284000, 0xc0000c0600) c:/go/firstsql/main.go:36 +0x4e4 net/http.HandlerFunc.ServeHTTP(0x8192a0, 0x8828a0, 0xc000284000, 0xc0000c0600) c:/go/src/net/http/server.go:2007 +0x4b net/http.(*ServeMux).ServeHTTP(0xade820, 0x8828a0, 0xc000284000, 0xc0000c0600) c:/go/src/net/http/server.go:2387 +0x1c4 net/http.serverHandler.ServeHTTP(0xc00015e000, 0x8828a0, 0xc000284000, 0xc0000c0600) c:/go/src/net/http/server.go:2802 +0xab net/http.(*conn).serve(0xc00004ae60, 0x883020, 0xc00003c8c0) c:/go/src/net/http/server.go:1890 +0x87c created by net/http.(*Server).Serve c:/go/src/net/http/server.go:2927 +0x395 2019/10/11 17:11:42 http: panic serving [::1]:59581: Error 1045: Access denied for user 'root'@'localhost' (using password: YES) goroutine 31 [running]: net/http.(*conn).serve.func1(0xc0001d43c0) c:/go/src/net/http/server.go:1767 +0x140 panic(0x771740, 0xc0000c8280) c:/go/src/runtime/panic.go:679 +0x1c0 main.Index(0x8828a0, 0xc0001dc1c0, 0xc0000e2500) c:/go/firstsql/main.go:36 +0x4e4 net/http.HandlerFunc.ServeHTTP(0x8192a0, 0x8828a0, 0xc0001dc1c0, 0xc0000e2500) c:/go/src/net/http/server.go:2007 +0x4b net/http.(*ServeMux).ServeHTTP(0xade820, 0x8828a0, 0xc0001dc1c0, 0xc0000e2500) c:/go/src/net/http/server.go:2387 +0x1c4 net/http.serverHandler.ServeHTTP(0xc00015e000, 0x8828a0, 0xc0001dc1c0, 0xc0000e2500) c:/go/src/net/http/server.go:2802 +0xab net/http.(*conn).serve(0xc0001d43c0, 0x883020, 0xc0000ec340) c:/go/src/net/http/server.go:1890 +0x87c created by net/http.(*Server).Serve c:/go/src/net/http/server.go:2927 +0x39 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com<mailto:golang-nuts+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/c46a6b48-1109-4698-ac21-c7f04464b936%40googlegroups.com<https://groups.google.com/d/msgid/golang-nuts/c46a6b48-1109-4698-ac21-c7f04464b936%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/VI1PR06MB5150B886F882E95DF7B43B319E970%40VI1PR06MB5150.eurprd06.prod.outlook.com.