当前位置:网站首页>MySQL instruction executes SQL file

MySQL instruction executes SQL file

2022-06-22 17:06:00 51CTO


mysql Command execution sql file

      
      
ERROR 1366 ( HY000): Incorrect string value:
'\xAD\xE8\x8F\x9C' for column 'catelogname' at row 1
  • 1.
  • 2.

1. Sign in MySQL

      
      
mysql -u root -p
  • 1.

2. Carry out orders

      
      
# The first method
mysql > source E :\aa .sql
# The second method
mysql > \. E :\aa .sql
  • 1.
  • 2.
  • 3.
  • 4.

3. Garbled code after import

Insert the following code at the beginning

      
      
set character set utf8 ;
drop database if exists ` Database name `
--
-- database : ` Database name `
--
CREATE DATABASE ` Database name ` DEFAULT CHARACTER SET utf8 ;
USE ` Database name ` ;
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.

If it still appears ????? That means your sql The document is not utf8 code ,
Change my , Just import it again .


原网站

版权声明
本文为[51CTO]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221532330848.html