Home > Database > Mysql Tutorial > mysql 排错方法

mysql 排错方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:39:55
Original
1663 people have browsed it

首先利用以下命令守株待兔 # tail -f /usr/local/mysql/log/mysql.log 然后在loganalyzer向导STEP6输入web后台账号密码后,点击NEXT 查看到mysql.log日志里出现了一条INSERT语句 然后将该语句复制到后台手动执行,看报什么错误 # mysql -uroot -p123456; INS

首先利用以下命令守株待兔

# tail -f /usr/local/mysql/log/mysql.log

然后在loganalyzer向导STEP6输入web后台账号密码后,点击NEXT

查看到mysql.log日志里出现了一条INSERT语句

然后将该语句复制到后台手动执行,看报什么错误

# mysql -uroot -p123456;

> INSERT INTO logcon_users (username, password, is_admin) VALUES (‘admin’, ’00a1f187721cxxxxxxx6bf791e69382c’, 1);

ERROR 1364 (HY000): Field ‘last_login’ doesn’t have a default value

提示’last_login’栏不能为空值

OK,直接登录navicat,将这栏设置为允许空值保存即可

从新执行这条语句

> INSERT INTO logcon_users (username, password, is_admin) VALUES (‘admin’, ’00a1f187721cxxxxxxx6bf791e69382c’, 1);

Query OK, 1 row affected (0.06 sec)

显示执行成功

利用navicat 查看后台该表,显示成功插入一条记录

重新利用该账号即可成功登录loganalyzer web后台

看来是mysql在执行该语句时,发现last_login栏默认为非空,所以拒绝这条insert语句执行,解决办法就是将该栏设置为允许空值即可

博主在线上老版本mysql-5.0.56无需进行上述手动操作,即可成功登录后台

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template