go链接mysql数据库

  • 屈志勇
  • 2021-10-07 16:43:51
  • go
  • go mqtt
```gopackage mainimport ( "github.com/jinzhu/gorm" _ "github.com/gosqldriver/mysql")func main() { db,err := gorm.Open("mysql", "test1:test123@(111.229.100.91:3306)/test1?charset=
阅读全文

go-操作mqtt发布订阅

  • 屈志勇
  • 2021-09-29 10:07:23
  • go
  • go mqtt
```gopackage mainimport ( "encoding/json" "fmt" mqtt "github.com/eclipse/paho.mqtt.golang" "time")var messagePubHandler mqtt.MessageHandler = func(client mqtt.Client, msg mqtt.Me
阅读全文

php安装mosquitto 来使用mqtt服务

```shell1、安装pecl安装yum install phpdevel phppear httpddevel2、使用pecl安装Mosquittoalphapecl install Mosquittoalpha3、添加 extension=mosquitto.so到你的PHP配置文件php.ini中。```订阅```php$clie
阅读全文