欢迎光临
我们一直在努力

navicat12快速导出生成mysql数据字典

admin阅读(305)

今天突然需要一份数据库字典,不可能挨个去手写,就去看了下navicat的方法,可以快速导出数据,不如我就将查询结果导出,下面我说下方法

新建查询:
SELECT
t.TABLE_SCHEMA AS ‘库名称’,
t.TABLE_NAME AS ‘表名’,
t.COLUMN_NAME AS ‘字段名’,
t.COLUMN_TYPE AS ‘字段类型’,
IF
( t.COLUMN_DEFAULT = ”, ‘空字符串’, IFNULL( t.COLUMN_DEFAULT, ‘无’ ) ) AS ‘默认值’,
t.COLUMN_COMMENT AS ‘字段备注’
FROM
information_schema.COLUMNS t
WHERE
TABLE_SCHEMA = ‘这里是你的数据库名或者表名都可以’

注意:只需要修改 TABLE_SCHEMA = ‘这里是你的数据库名或者表名都可以’ 这句,其他不要动,select看你需要的结果就可以了


这个是查询结果,我们将查询结果导出
上面有个导出结果
导出的就是你查询的样子
一般是导出excel或者word,以前有word格式,现在没有了
这个页面也许大家不一样,没关系,多的不用管

1130 – Host ‘****’ is not allowed to connect to this MySQL server 的解决办法

admin阅读(293)

在阿里云装完MySQL数据库后,在本地使用工具连接连不上,提示 : 1130 – Host ‘****’ is not allowed to connect to this MySQL server ,

首先我们先确认我们阿里云或者腾讯云其他平台后台设置的端口是否打开,也就是3306

同时我这里安装了宝塔控制面板,(不知道的不用管),我们也要在宝塔上打开它

然后我们先测试能不能连接,如果不能我们继续下一步

首先在连接工具那里连接上数据库,依次输入下面的命令:

1.mysql -uroot -p #这里会提示你输入数据库密码

2.use mysql;

3.update user set host = ‘%’ where user = ‘root’; #这一步就是最关键的, 将host设置为%表示任何ip都能连接mysql,当然也可指定为某个特定ip

最后一步: flush privileges; #刷新权限表,使配置生效

nested exception is java.sql.SQLException: The server time zone value ‘Öйú±ê׼ʱ¼ä’

admin阅读(172)

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.Tue Apr 30 21:15:36 CST 2019There was an unexpected error (type=Internal Server Error, status=500).nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: The server time zone value ‘Öйú±ê׼ʱ¼ä’ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support. ### The error may exist in com/mkl/mapper/UserMapper.java (best guess) ### The error may involve com.mkl.mapper.UserMapper.selectByPrimaryKey ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: The server time zone value ‘Öйú±ê׼ʱ¼ä’ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

这是今天在学习spring cloud的时候,连接数据库出现的bug,用的spring的手脚架创建的项目,看了下是MySQL默认的时区是UTC时区 的问题,临时解决方法是在连接地址后面跟?serverTimezone=GMT%2B8,也就是这样jdbc:mysql://localhost:3306/mybatis?serverTimezone=GMT%2B8,现在能正常获取数据了,永久解决的话:修改mysql的配置文件,添加:default-time-zone=’+08:00’,重启mysql生效

专注Java后端技术 我在努力

联系我们联系我们