Home > Database > Mysql Tutorial > body text

MySQL中文乱码以及导出为sql语句和Excel问题解决

WBOY
Release: 2016-06-07 17:28:07
Original
1091 people have browsed it

先说明一下自己的环境:Mac OS X 10.8.3, MySQL Community Server 5.6.10, MySQL Workbench 5.2.47。我想把本机数据库内的数据迁

这几天基于Heritrix写了一个爬虫,用到mysql,在导入导出数据时,遇到一些乱码问题,好不容易解决了,记录一下,以备查看。

一、导出数据。

先说明一下自己的环境:Mac OS X 10.8.3, MySQL Community Server 5.6.10, MySQL Workbench 5.2.47。

我想把本机数据库内的数据迁移到另一台机器上,,于是使用Workbench中自带的import/export功能,其实就是调用mysqldump。不幸的是,出现了版本不一致的错误。

错误没治了,最终找到解决方案,可以指定mysql的mysqldump,路径为:/usr/local/mysql/bin/mysqldump,这样是把数据导出为sql语句的insert语句。

由于需要是把数据导出为excel,所以通过mysql控制台使用select语句把数据导出到excel文件中。

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!