1.Converting circular structure to JSON
使用express时报了一个这样的错
解决:这里需要把JSON对象转化成JSON字符串,具体看图:
2.[root@VM_0_7_centos app]# babel-node app
-bash: babel-node: command not found
这个我感觉很奇怪,后来百度了一下,他们说是还要配置一下环境变量,可是我已经用 -g全局安装了,算了直接简单粗暴
使用这句 ./node_modules/.bin/babel-node app.js,因为对linux不太熟所以直接这样好了以后在改进。
3. Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
连接mysql时又报了这个错。
解决:
1. ALTER USER 'root'@'localhost' IDENTIFIED BY 'yourpassword,' PASSWORD EXPIRE NEVER; (如果这句还是执行不了,报了这个错:ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'localhost',
那么你就得先
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select user, host from user
-> ;
+------------------+-----------+
| user | host |
+------------------+-----------+
| root | % |
| mysql.infoschema | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
+------------------+-----------+
我这root对应的是%,所以改成ALTER USER 'root'@'%' IDENTIFIED BY 'yourpassword,' PASSWORD EXPIRE NEVER; 就ok,具体原理我也不清楚。
2.mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'newpassword';(修改密码,可有可无)
3.mysql> FLUSH PRIVILEGES; (这样应该就ok了)
4.客户端在调用api时还是失败了,第一反应是防火墙问题,
1.firewall-cmd --state 先查看防火墙状态
2.systemctl stop firewalld.service 最简单的方法直接关闭,关了后api就调用成功了!