6G数据库的导入 报各种错误的解决办法
今天看到一高人的mysql数据库达到了6G左右,导入都是个问题,上传也挺麻烦的,这里特分享下,方便需要的朋友
工具选择一。sqlyog 这个工具还是很强大的,但是面对5个G的数据库来说,也只能罢工了,简单说,本机导入可以,从本机导入服务器不行。
二。phpadmin 自带的这个挺人家说还行,但是最后没用过,原因是看不见,因为最多50M,虽然修改配置文件可以上传但是5个G还是算了吧,没那个信心。
三。还有一个是一个PHP脚本。好像是德国人写的。这个东西,也是导入数据的,怎嘛说呢,本人是没试验成功。但是网上叫好一片,我是5G数据没点成功,这是折腾了第二天了。
四。数据库分割导入这个我也用到了,每个分割100M,汗一下。不能再小了。。。分割出60多个SQL,还是会报各种错误。这个工具也失败了。如果你想用,去网上找找吧mysql分割
下面的图片就是导入成功后的图片了,
GZ压缩式1.3G解压后变成4.52G。导入到数据库,就变成6.6G了。。。。。
最后还是用命令导进去的
mysql -uroot -p shujukuming
再说下错误吧
简单的说就是各种错误都能遇到
错误1
ERROR 5 (HY000) at line 318: Out of memory (Needed 1681784 bytes)
这个错误能报很多 是使用 -f 报出来的,大致意思是内存不足,
解决办法 :mysql -uroot -p shujukuming -f
错误2
ERROR 1062 (23000) at line 30: Duplicate entry '1' for key 'PRIMARY'
这个错误是键值错误的意思
解决办法:网上说是要清空数据表数据,可是在用数据分区的时候主键和分区时不能同时使用,把主键在更改下就行
错误3
mysql error nr.2006-mysql server has gone away
这个错误是 上传限制的问题需要修改配置文件
配置文件在 linx叫 my.conf 在windows叫my.ini
这里面的东西修改要小心了乱改是不行的。
简单的就是修改几个配置就行了
max_allowed_packet=166666m 这个是限制文件大小的由于要上传6个G所以改成1111111M 额应该够了吧
wait_timeout=288000000 等待超时。。看事改吧,我在后面加了好几个0.。。
interactive_timeout= 288000000运行超时。。。。看事改吧,我在后面加了好几个0.。。
除了几个就不要修改其他的配置文件了,注意重启下服务器
错误4
这个是个很低级的错误
mysql 版本不对 现在流行的都是5.0+
注意高版本不能导入低的版本,5.5+是不能导入到5.0+的有些查询语句不支持。
转帖请标明来源谢谢 http://skss.blog.163.com/
以上就是本人遇到的各种问题,如有其它问题请多多指教,毕竟6个G的文件啥sql也打不开

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Go language is an efficient, concise and easy-to-learn programming language. It is favored by developers because of its advantages in concurrent programming and network programming. In actual development, database operations are an indispensable part. This article will introduce how to use Go language to implement database addition, deletion, modification and query operations. In Go language, we usually use third-party libraries to operate databases, such as commonly used sql packages, gorm, etc. Here we take the sql package as an example to introduce how to implement the addition, deletion, modification and query operations of the database. Assume we are using a MySQL database.

Do you know how to import external playlists on Soda Music App? Many users of the latest version of Soda Music App, when importing some playlists, do not like to import their own songs into the playlist, but this is limited. You can manage the classification of some of your songs very well when you listen to it, so friends who have ideas must give it a try and find out more. I believe you will like it, and you can have any ideas. Step-by-step tutorial for importing external playlists from Soda Music: 1. On the Soda Music app page, click and select the lower right corner to create a playlist. 2. Create a page, enter the playlist name, and click Save. 3. On the My Playlist page, select Add Songs. 4. Search, select your favorite songs, and add them to the playlist

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

HTML cannot read the database directly, but it can be achieved through JavaScript and AJAX. The steps include establishing a database connection, sending a query, processing the response, and updating the page. This article provides a practical example of using JavaScript, AJAX and PHP to read data from a MySQL database, showing how to dynamically display query results in an HTML page. This example uses XMLHttpRequest to establish a database connection, send a query and process the response, thereby filling data into page elements and realizing the function of HTML reading the database.

Analysis of the basic principles of the MySQL database management system MySQL is a commonly used relational database management system that uses structured query language (SQL) for data storage and management. This article will introduce the basic principles of the MySQL database management system, including database creation, data table design, data addition, deletion, modification, and other operations, and provide specific code examples. 1. Database Creation In MySQL, you first need to create a database instance to store data. The following code can create a file named "my

PHP is a back-end programming language widely used in website development. It has powerful database operation functions and is often used to interact with databases such as MySQL. However, due to the complexity of Chinese character encoding, problems often arise when dealing with Chinese garbled characters in the database. This article will introduce the skills and practices of PHP in handling Chinese garbled characters in databases, including common causes of garbled characters, solutions and specific code examples. Common reasons for garbled characters are incorrect database character set settings: the correct character set needs to be selected when creating the database, such as utf8 or u
