Jump to content

change server file sql too large about 100 mb


Recommended Posts

Please I know I can do it manually selecting portions of sql file and paste in sql phpmyadmin and click on start... but is too much work

 

It does exist anything that split sql in automatic and then I import sql splitted?

I use server with linux centos.

Please...

Link to comment
Share on other sites

you can split portions of the file into more managable file sizes. basically a backup sql file contains 2 things for each database table

 

1) the create table statement

2) the import records into that table statement

 

For instance, the first table in that file is likely ps_access, so the statement to create the table comes first.

/* Scheme for table ps_access */
DROP TABLE IF EXISTS `ps_access`;
CREATE TABLE `ps_access` (
 `id_profile` int(10) unsigned NOT NULL,
 `id_tab` int(10) unsigned NOT NULL,
 `view` int(11) NOT NULL,
 `add` int(11) NOT NULL,
 `edit` int(11) NOT NULL,
 `delete` int(11) NOT NULL,
 PRIMARY KEY (`id_profile`,`id_tab`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

 

followed by the statement to insert the records

INSERT INTO `ps_access` VALUES
('1','1','1','1','1','1'),
etc...

 

you could technically split the single large file into a file per table, but that will be alot of work. I would suggest trying to get them into 5-8mb size files at most, smaller if you can. Then you can just execute each one.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...