strapi-cms

414 阅读1分钟
  1. 打开官网 docs.strapi.io/
  2. 注意版本和官网推荐的对应,要不然会有各种奇怪的报错。
报错:Client does not support authentication protocol requested by server; consider upgrading MySQL client

原因:最新的mysql模块并未完全支持MySQL 8的caching_sha2_password加密,而“caching_sha2_password”在MySQL 8中是默认的加密方式。因此,下面的方式命令是默认已经使用了“caching_sha2_password”加密方式,该账号、密码无法在mysql模块中使用。  

解决方法:改变数据库的加密方式:
 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';

3.strapi-cms汉化

新建src/admin/app.js文件,添加如下代码

export default {
  config: {
    locales: ["en", "zh-Hans"],
    tutorials: false,
  },
  bootstrap() {},
};

删除缓存 /.cache ,/build,并重新运行。
在admin面板,个人中心,语言选中简体中文

4.备份mysql命令

mysqldump -u root -p nestdemo1 > backup_file.sql