今天在把一个sql文件导入到数据库的时候因为中文编码报错了,下面是解决该问题的方法:

  1. 连接数据库时设置编码
mysql -u root -p --default-character-set=utf8
  1. 切换到需要导入的数据库
use dbname
  1. 使用source命令导入
 source db.sql  

db.sql时.sql文件所在路径

相关文章:

  • 2021-06-18
  • 2021-06-18
  • 2021-05-29
  • 2022-12-23
  • 2021-04-10
  • 2022-12-23
猜你喜欢
  • 2021-06-02
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
  • 2022-02-06
  • 2021-05-09
  • 2021-08-02
相关资源
相似解决方案