Coder Social home page Coder Social logo

無法註冊帳號 about fe HOT 5 OPEN

open-falcon-archive avatar open-falcon-archive commented on August 18, 2024
無法註冊帳號

from fe.

Comments (5)

RealLiuSha avatar RealLiuSha commented on August 18, 2024 3

如果你的建表语句OK的话, 问题可能是这样的:

Mysql 5.6以上的版本不支持隐式默认值,

如需要兼容 你可以尝试:
explicit_defaults_for_timestamp=0

但你启动mysql时可能会再log 里看到一些warning,

需后续开发成员对程序进行一些更新,不要传递nil 即可

from fe.

yyjinlong avatar yyjinlong commented on August 18, 2024 1

在my.cnf配置文件[mysqld]节中设置:
explicit_defaults_for_timestamp= 0
重启mysql即可。

from fe.

UlricQin avatar UlricQin commented on August 18, 2024

你的建表语句有问题:https://github.com/open-falcon/scripts/blob/master/db_schema/uic-db-schema.sql#L11 这个是有default值的,所以不会出错才对

from fe.

chenqi123 avatar chenqi123 commented on August 18, 2024

1、修改文件fe/http/uic/user_controller.go
import (
...

    "time" //新增

)

func (this *UserController) CreateRoot() {
...

    userPtr := &User{

            Created: time.Now(), //新增
    }  
    ...

}
重新control build 可以設置 fe 的 root 帳號的密碼為 abc

2、修改文件fe/model/uic/user.go

func InsertRegisterUser(name, password string) (int64, error) {
userPtr := &User{
Name: name,
Passwd: password,
Created: time.Now(),//新增
}
return userPtr.Save()
}
重新control build 可以註冊普通用戶

3、修改文件fe/model/uic/team.go

func SaveTeamAttrs(name, resume string, creator int64) (int64, error) {
//t := &Team{Name: name, Resume: resume, Creator: creator}
t := &Team{Name: name, Resume: resume, Creator: creator,Created:time.Now()} //修改为此
return t.Save()
}
重新control build 可以增加用户组

from fe.

netqyq avatar netqyq commented on August 18, 2024

@itchenyi
mysql> set explicit_defaults_for_timestamp=0 ;
ERROR 1238 (HY000): Variable 'explicit_defaults_for_timestamp' is a read only variable

from fe.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.