Comments (6)
你好,这个需要在配置文件里激活Mysql配置
才会在配置方法里初始化
from stack-rpc-tutorials.
激活了,但是跑的时候panic了,initMysql没有返回连接会有问题吧
from stack-rpc-tutorials.
不会,看是不是配置没有初始化,main函数里初始化了没。initMysql会把config中的私有变量mysql赋值,而不是返回
// 初始化配置、数据库等信息
basic.Init()
from stack-rpc-tutorials.
initMysql是执行了,而且也连接了,但是db.go:GetDB()返回nil,感觉db.go:mysqlDB 没有被初始化
from stack-rpc-tutorials.
哪个示例?方便的话进slack沟通,进入后进入**区,或私聊我
from stack-rpc-tutorials.
代码写错了
写成
mysqlDB, err := sql.Open("mysql", config.GetMysqlConfig().GetURL())
from stack-rpc-tutorials.
Related Issues (20)
- K8s示例 HOT 4
- part1 user-srv运行micro --registry=etcd call mu.micro.book.srv.user User.QueryUserByName '{"userName":"micro"}'报错 HOT 5
- part2 运行问题。 HOT 2
- Micro auto generate topic in kafka when run 1 service. HOT 1
- rpc 调用不通,一直报错 HOT 5
- 一点小提议~ HOT 3
- 根据原文件运行part1出现error HOT 3
- 获取Session中的UserId时,空指针异常 HOT 2
- examples/basic-practices/micro-service/stream/file 问题 HOT 5
- 运行part1时提交请求时出错 HOT 9
- model操作数据实现方式不太明白问题 HOT 1
- 第一章演示user protobuf的问题 HOT 1
- micro api handler value 支持的类型 HOT 2
- 【重要】part 1 根据代码库操作报错 HOT 2
- 在part1中最后的curl请求返回为空 HOT 2
- 第七章, 通过网关不能直接访问到 user_web 服务 HOT 1
- 关于micro auth 的问题 HOT 4
- v3出来了。请同步。 HOT 1
- 求更新v3文档,支持 HOT 1
- 大佬们,v2的文档能不能再放出来一下,才刚开始看就没了 --。 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stack-rpc-tutorials.