casbin / casbin-hub

The hub for Casbin
https://dashboard.casbin.com
Apache License 2.0
88 stars 46 forks source link

Error on go run main.go" #11

Closed aryamanpuri closed 4 years ago

aryamanpuri commented 4 years ago

@hsluoyz Can You help with this? ERROR DESCRIPTION I am getting an error on doing go run main.go while running backend.

Screenshot from 2020-02-21 23-15-53

ashu8912 commented 4 years ago

hey @aryamanpuri can you show your logs.

aryamanpuri commented 4 years ago

2020/02/21 23:45:10.796 [I] [parser.go:112] generate router from comments panic: Error 1698: Access denied for user 'root'@'localhost'

goroutine 1 [running]: github.com/casbin/casbin-dashboard/object.(*OrmManager).open(0xc00017e900) /home/aryaman/go/src/github.com/casbin/casbin-dashboard/object/orm_manager.go:60 +0x131 github.com/casbin/casbin-dashboard/object.NewOrmManager(0xb468dc, 0x5, 0xc000024880, 0x1d, 0x1d) /home/aryaman/go/src/github.com/casbin/casbin-dashboard/object/orm_manager.go:39 +0x7d github.com/casbin/casbin-dashboard/object.InitOrmManager() /home/aryaman/go/src/github.com/casbin/casbin-dashboard/object/orm_manager.go:14 +0x73 main.main() /home/aryaman/casbin-dashboard/main.go:13 +0x26 exit status 2

ani4aniket commented 4 years ago

Hello, @aryamanpuri actually the problem is with mysql server not with go main server. Make sure to start your mysql server.

swetankkk commented 4 years ago

@aryamanpuri Just go to your Terminal and enter into MY-SQL by entering sudo mysql -u root Now switch your root user's plugin from auth_socket to mysql_native_password and change password to 123 by entering the following SQL statement ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 123; then exit; now run your go server again by go run main.go If you still face issues feel free to text on the Casbin Gitter channel

devabhixda commented 4 years ago

Ensure your SQL server is up and running on port 3306. By default root user is tried to log in using '123' as password but as mentioned in Readme that's configurable as per your will. Just update the configs in the app.conf file that's located at https://github.com/casbin/casbin-dashboard/blob/master/conf/app.conf . Also ensure you put this file in .gitignore so as to avoid commiting it.

devabhixda commented 4 years ago

@aryamanpuri can you update us on the status of this issue so that we can close it if no more action is needed.