BetterJS / doc

Description of badjs
586 stars 70 forks source link

启动时提示Access denied for user 'root'@'localhost' (using password: YES)的问题 #30

Open Jerry379 opened 5 years ago

Jerry379 commented 5 years ago

使用npm run start启动项目时提示Access denied for user 'root'@'localhost' (using password: YES); -本地mysql密码设置的是123456,使用命令行mysql -uroot -p可以登录,但是在代码中将默认的root密码改为123456就报错。

GracefulTing commented 5 years ago

我也遇到了同样的问题,解决了吗?

GracefulTing commented 5 years ago

使用npm run start启动项目时提示Access denied for user 'root'@'localhost' (using password: YES); -本地mysql密码设置的是123456,使用命令行mysql -uroot -p可以登录,但是在代码中将默认的root密码改为123456就报错。

  • 将本地mysql的root密码改为root在运行可以正常运行。 是不是使用纯数字的密码有问题?我是用的是win10系统,mysql是5.7.22

你好,这个问题解决了吗?我也是同样的问题,我设置的密码是英文也报错,还没尝试改为root,但是改了代码依然会提示Access denied for user 'root'@'localhost' (using password: YES)

loskael commented 5 years ago

参考

GracefulTing commented 5 years ago

参考

好的,我看一下

GracefulTing commented 5 years ago

参考

这个我暂时跳过了mysql的权限验证解决了,但是还是没能启动成功

========== badjs-web ========= [2019-03-26 11:28:44.688] [INFO] [default] - running in debug [2019-03-26 11:28:45.117] [DEBUG] [default] - query url : http://127.0.0.1:9000/query express-session deprecated undefined resave option; provide resave option badjs-web\workflow\ExpressInitWorker.js:23:9 express-session deprecated undefined saveUninitialized option; provide saveUninitialized option badjs-web\workflow\ExpressInitWorker.js:23:9 [2019-03-26 11:28:45.251] [INFO] [default] - connect mysql: mysql://root:root@localhost:3306/badjs [2019-03-26 11:28:45.362] [INFO] [default] - starting mq ... [2019-03-26 11:28:45.462] [INFO] [default] - create ProcessPool , number : 15 [2019-03-26 11:28:45.469] [INFO] [default] - start badjs-web , listen 8081 ... (node:16652) [DEP0016] DeprecationWarning: 'GLOBAL' is deprecated, use 'global' [2019-03-26 11:28:45.653] [INFO] [default] - mysql connected [2019-03-26 11:28:48.517] [INFO] [default] - start Statistics ... [2019-03-26 11:28:48.522] [DEBUG] [default] - query url : http://127.0.0.1:9000/errorMsgTop [2019-03-26 11:28:48.524] [INFO] [default] - after 52271.477s will fetch again [2019-03-26 11:28:48.526] [DEBUG] [default] - query url : http://127.0.0.1:9000/query [2019-03-26 11:28:48.532] [INFO] [default] - offline_log_monitor.db success [2019-03-26 11:28:48.533] [INFO] [default] - offline service start ok... [2019-03-26 11:28:48.589] [INFO] [default] - start email report ... [2019-03-26 11:28:48.591] [DEBUG] [default] - query url : http://127.0.0.1:9000/errorMsgTop [2019-03-26 11:28:48.595] [INFO] [default] - Email service will start after: 77471405 [2019-03-26 11:28:48.640] [INFO] [default] - update project.db :{} [2019-03-26 11:28:48.640] [INFO] [default] - push projectIds to acceptor success [2019-03-26 11:28:52.322] [WARN] [default] - push projectIds to open error :Error: connect ECONNREFUSED 127.0.0.1:9002 [2019-03-26 11:58:42.981] [INFO] [default] - [4196]:stringify spend time : 0 [2019-03-26 11:58:42.982] [INFO] [default] - [4196]flush cache to disk , path : C:\Users\Grace\Desktop\badjs-installer\badjs-storage\cache\total\2019-03-26_0 fs.js:133 throw new ERR_INVALID_CALLBACK(); ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function at maybeCallback (fs.js:133:9) at Object.writeFile (fs.js:1132:14) at flushCacheToDisk (C:\Users\Grace\Desktop\badjs-installer\badjs-storage\service\realTotalWorker.js:104:8) at Timeout._onTimeout (C:\Users\Grace\Desktop\badjs-installer\badjs-storage\service\realTotalWorker.js:122:9) at ontimeout (timers.js:427:11) at tryOnTimeout (timers.js:289:5) at listOnTimeout (timers.js:252:5) at Timer.processTimers (timers.js:212:10)

loskael commented 5 years ago

@GracefulTing

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function

版本问题,参考 https://github.com/BetterJS/doc/issues/26

GracefulTing commented 5 years ago

@GracefulTing

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function

版本问题,参考 #26

//监听未捕获的异常 process.on('uncaughtException',function(err){ console.log(err) })

//监听Promise没有被捕获的失败函数 process.on('unhandledRejection',function(err,promise){ console.log(err) })

我参考了 #26 的回复,在realTotalWorker.js中添加了这段代码,依然没有解决。

loskael commented 5 years ago

添加 uncaughtException 和 unhandledRejection 并不能修复问题,只能保证发生异常时服务不退出

GracefulTing commented 5 years ago

添加 uncaughtException 和 unhandledRejection 并不能修复问题,只能保证发生异常时服务不退出

好吧,但是它卡在这里都没法运行起来怎么解决呢