急急急MySQL5.5数据库初始化报Unhandled rejection Error错误怎么解决
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了急急急MySQL5.5数据库初始化报Unhandled rejection Error错误怎么解决相关的知识,希望对你有一定的参考价值。
Unhandled rejection Error: Error: /*
Navicat Premium Data Transfer
Source Server : Localhost
Source Server Type : mysql
Source Server Version : 50717
Source Host : localhost
Source Database : cAuth
Target Server Type : MySQL
Target Server Version : 50717
File Encoding : utf-8
Date: 08/10/2017 22:22:52 PM
*/
SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for `cSessionInfo`
-- ----------------------------
DROP TABLE IF EXISTS `cSessionInfo`;
CREATE TABLE `cSessionInfo` (
`open_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`uuid` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`skey` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_visit_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`session_key` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`user_info` varchar(2048) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`open_id`),
KEY `openid` (`open_id`) USING BTREE,
KEY `skey` (`skey`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='会话管理用户信息';
SET FOREIGN_KEY_CHECKS = 1;
- ER_TOO_MUCH_AUTO_TIMESTAMP_COLS: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
at DB.raw.then.err (C:\Users\Administrator\my-project\server\tools\initdb.js:41:11)
at tryCatcher (C:\Users\Administrator\my-project\server\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\Users\Administrator\my-project\server\node_modules\bluebird\js\release\promise.js:512:31)
at Promise._settlePromise (C:\Users\Administrator\my-project\server\node_modules\bluebird\js\release\promise.js:569:18)
at Promise._settlePromise0 (C:\Users\Administrator\my-project\server\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (C:\Users\Administrator\my-project\server\node_modules\bluebird\js\release\promise.js:689:18)
at Async._drainQueue (C:\Users\Administrator\my-project\server\node_modules\bluebird\js\release\async.js:133:16)
at Async._drainQueues (C:\Users\Administrator\my-project\server\node_modules\bluebird\js\release\async.js:143:10)
at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\Administrator\my-project\server\node_modules\bluebird\js\release\async.js:17:14)
at runCallback (timers.js:696:18)
at tryOnImmediate (timers.js:667:5)
at processImmediate (timers.js:649:5)
根据wordpress官方的解释,在导入数据库之前,只需要把utf8mb4编码转成utf-8就可以了,有两种方法可以替换数据库编码:
实践了一下,有效的解决办法如下:
一、替换代码
从老的数据库中导出的数据库文件,用ue等代码编辑器打开。
查找:utf8mb4_unicode_ci,全部替换为:utf8_general_ci
查找:utf8mb4 全部替换为 utf8
按照顺序完成上面的操作。保存。
二、修改文件
修改wordpress的配置文件wp-config.php
把define(‘DB_CHARSET’, ‘utf8mb4’);
改为define(‘DB_CHARSET’, ‘utf-8’);
完成之后,基本能解决问题了。 参考技术A mysql 初始化数据库报错
bin/mysqld \
> --initialize-insecure \
2018-07-09T09:01:33.092169Z
0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please
use --explicit_defaults_for_timestamp server option (see documentation
for more details).
2018-07-09T09:01:33.093305Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2018-07-09T09:01:33.099451Z 0 [ERROR] Too many arguments (first extra is ' ').
2018-07-09T09:01:33.093325Z 0 [ERROR] Aborting
报错
[ERROR] --initialize specified but the data directory has files in it. Aborting.
解决方法 删除data 原因 ,可能是重复安装 mysql 导致 data文件夹下有文件
rm -rf /usr/local/mysql/data/*
报错
[ERROR] Too many arguments (first extra is ' ').
初始化命令有空格或者' '里面的命令未能识别
以上是关于急急急MySQL5.5数据库初始化报Unhandled rejection Error错误怎么解决的主要内容,如果未能解决你的问题,请参考以下文章
Tomcat报HTTP Status 500 - Servlet execution threw an exception错,请大神指点,急急急!!!!
telnet出现以下报错Escape character is '^]'. ,急急急