Comment découper une sauvegarde SQL Intermédiaire

Comment découper une sauvegarde SQL

Découpe sauvegarde SQL


- Comment découper une sauvegarde en petits morceaux.


Lorsqu'une sauvegarde est assez conséquente (par exemple : 7mo) , il n'est pas possible de la réinjecter en une seule fois dans phpMyAdmin.
Dans ce tutoriel, on va voir comment découper les grosses sauvegardes (qui sont sous forme .sql) pour pouvoir les envoyer à phpmyadmin.


1) Découpage

    A) Comment faire la sauvegarde ?

    Consultez ce lien : Faire une sauvegarde

    B) Où découper ?

    Ouvrez le fichier de sauvegarde (.sql) avec une éditeur (par exemple : Notepad++)

    NB: Evitez blocnote :).

    Une fois votre fichier ouvert, vous avez quelque chose comme ceci :


    Code: Tout sélectionner
    -- 
    -- Structure de la table `phpbb_smilies`
    -- 
    
    CREATE TABLE phpbb_smilies (
    smiley_id mediumint(8) UNSIGNED NOT NULL auto_increment,
    code varchar(50) DEFAULT '' NOT NULL,
    emotion varchar(50) DEFAULT '' NOT NULL,
    smiley_url varchar(50) DEFAULT '' NOT NULL,
    smiley_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
    smiley_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
    smiley_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
    display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
    PRIMARY KEY (smiley_id),
    KEY display_on_post (display_on_posting)
    ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
    
    -- 
    -- Contenu de la table `phpbb_smilies`
    -- 
    
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':D', 'icon_e_biggrin.gif', '{L_SMILIES_VERY_HAPPY}', 15, 17, 1);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-D', 'icon_e_biggrin.gif', '{L_SMILIES_VERY_HAPPY}', 15, 17, 2);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':grin:', 'icon_e_biggrin.gif', '{L_SMILIES_VERY_HAPPY}', 15, 17, 3);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':)', 'icon_e_smile.gif', '{L_SMILIES_SMILE}', 15, 17, 4);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-)', 'icon_e_smile.gif', '{L_SMILIES_SMILE}', 15, 17, 5);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':smile:', 'icon_e_smile.gif', '{L_SMILIES_SMILE}', 15, 17, 6);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (';)', 'icon_e_wink.gif', '{L_SMILIES_WINK}', 15, 17, 7);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (';-)', 'icon_e_wink.gif', '{L_SMILIES_WINK}', 15, 17, 8);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':wink:', 'icon_e_wink.gif', '{L_SMILIES_WINK}', 15, 17, 9);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':(', 'icon_e_sad.gif', '{L_SMILIES_SAD}', 15, 17, 10);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-(', 'icon_e_sad.gif', '{L_SMILIES_SAD}', 15, 17, 11);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':sad:', 'icon_e_sad.gif', '{L_SMILIES_SAD}', 15, 17, 12);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':o', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 19, 13);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-o', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 19, 14);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':eek:', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 19, 15);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':shock:', 'icon_eek.gif', '{L_SMILIES_SHOCKED}', 15, 15, 16);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':?', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 17);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-?', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 18);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':???:', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 19);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES ('8-)', 'icon_cool.gif', '{L_SMILIES_COOL}', 15, 15, 20);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':cool:', 'icon_cool.gif', '{L_SMILIES_COOL}', 15, 15, 21);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':lol:', 'icon_lol.gif', '{L_SMILIES_LAUGHING}', 15, 15, 22);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':x', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 15, 23);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-x', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 15, 24);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':mad:', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 15, 25);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':P', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 15, 26);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-P', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 15, 27);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':razz:', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 15, 28);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':oops:', 'icon_redface.gif', '{L_SMILIES_EMARRASSED}', 15, 15, 29);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':cry:', 'icon_cry.gif', '{L_SMILIES_CRYING}', 15, 15, 30);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':evil:', 'icon_evil.gif', '{L_SMILIES_EVIL}', 15, 15, 31);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':twisted:', 'icon_twisted.gif', '{L_SMILIES_TWISTED_EVIL}', 15, 15, 32);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':roll:', 'icon_rolleyes.gif', '{L_SMILIES_ROLLING_EYES}', 15, 15, 33);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':!:', 'icon_exclaim.gif', '{L_SMILIES_EXCLAMATION}', 15, 15, 34);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':?:', 'icon_question.gif', '{L_SMILIES_QUESTION}', 15, 15, 35);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':idea:', 'icon_idea.gif', '{L_SMILIES_IDEA}', 15, 15, 36);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':arrow:', 'icon_arrow.gif', '{L_SMILIES_ARROW}', 15, 15, 37);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':|', 'icon_neutral.gif', '{L_SMILIES_NEUTRAL}', 15, 15, 38);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-|', 'icon_neutral.gif', '{L_SMILIES_NEUTRAL}', 15, 15, 39);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':mrgreen:', 'icon_mrgreen.gif', '{L_SMILIES_MR_GREEN}', 15, 15, 40);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':geek:', 'icon_e_geek.gif', '{L_SMILIES_GEEK}', 17, 17, 41);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':ugeek:', 'icon_e_ugeek.gif', '{L_SMILIES_UBER_GEEK}', 19, 18, 42);


    Toute ligne qui commence par -- est une commentaire et donc pas nécéssaire pour réinjecter dans la base.

    Vous pouvez découper là ou vous voyez un ; (point-virgule)

    Par exemple, le code SQL ci-dessus peut être découpé comme ceci :

    Code: Tout sélectionner
    
    CREATE TABLE phpbb_smilies (
    smiley_id mediumint(8) UNSIGNED NOT NULL auto_increment,
    code varchar(50) DEFAULT '' NOT NULL,
    emotion varchar(50) DEFAULT '' NOT NULL,
    smiley_url varchar(50) DEFAULT '' NOT NULL,
    smiley_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
    smiley_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
    smiley_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
    display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
    PRIMARY KEY (smiley_id),
    KEY display_on_post (display_on_posting)
    ) CHARACTER SET `utf8` COLLATE `utf8_bin`;


    et

    Code: Tout sélectionner
    
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':D', 'icon_e_biggrin.gif', '{L_SMILIES_VERY_HAPPY}', 15, 17, 1);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-D', 'icon_e_biggrin.gif', '{L_SMILIES_VERY_HAPPY}', 15, 17, 2);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':grin:', 'icon_e_biggrin.gif', '{L_SMILIES_VERY_HAPPY}', 15, 17, 3);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':)', 'icon_e_smile.gif', '{L_SMILIES_SMILE}', 15, 17, 4);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-)', 'icon_e_smile.gif', '{L_SMILIES_SMILE}', 15, 17, 5);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':smile:', 'icon_e_smile.gif', '{L_SMILIES_SMILE}', 15, 17, 6);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (';)', 'icon_e_wink.gif', '{L_SMILIES_WINK}', 15, 17, 7);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (';-)', 'icon_e_wink.gif', '{L_SMILIES_WINK}', 15, 17, 8);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':wink:', 'icon_e_wink.gif', '{L_SMILIES_WINK}', 15, 17, 9);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':(', 'icon_e_sad.gif', '{L_SMILIES_SAD}', 15, 17, 10);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-(', 'icon_e_sad.gif', '{L_SMILIES_SAD}', 15, 17, 11);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':sad:', 'icon_e_sad.gif', '{L_SMILIES_SAD}', 15, 17, 12);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':o', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 19, 13);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-o', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 19, 14);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':eek:', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 19, 15);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':shock:', 'icon_eek.gif', '{L_SMILIES_SHOCKED}', 15, 15, 16);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':?', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 17);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-?', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 18);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':???:', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 19);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES ('8-)', 'icon_cool.gif', '{L_SMILIES_COOL}', 15, 15, 20);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':cool:', 'icon_cool.gif', '{L_SMILIES_COOL}', 15, 15, 21);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':lol:', 'icon_lol.gif', '{L_SMILIES_LAUGHING}', 15, 15, 22);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':x', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 15, 23);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-x', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 15, 24);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':mad:', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 15, 25);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':P', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 15, 26);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-P', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 15, 27);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':razz:', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 15, 28);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':oops:', 'icon_redface.gif', '{L_SMILIES_EMARRASSED}', 15, 15, 29);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':cry:', 'icon_cry.gif', '{L_SMILIES_CRYING}', 15, 15, 30);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':evil:', 'icon_evil.gif', '{L_SMILIES_EVIL}', 15, 15, 31);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':twisted:', 'icon_twisted.gif', '{L_SMILIES_TWISTED_EVIL}', 15, 15, 32);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':roll:', 'icon_rolleyes.gif', '{L_SMILIES_ROLLING_EYES}', 15, 15, 33);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':!:', 'icon_exclaim.gif', '{L_SMILIES_EXCLAMATION}', 15, 15, 34);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':?:', 'icon_question.gif', '{L_SMILIES_QUESTION}', 15, 15, 35);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':idea:', 'icon_idea.gif', '{L_SMILIES_IDEA}', 15, 15, 36);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':arrow:', 'icon_arrow.gif', '{L_SMILIES_ARROW}', 15, 15, 37);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':|', 'icon_neutral.gif', '{L_SMILIES_NEUTRAL}', 15, 15, 38);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-|', 'icon_neutral.gif', '{L_SMILIES_NEUTRAL}', 15, 15, 39);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':mrgreen:', 'icon_mrgreen.gif', '{L_SMILIES_MR_GREEN}', 15, 15, 40);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':geek:', 'icon_e_geek.gif', '{L_SMILIES_GEEK}', 17, 17, 41);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':ugeek:', 'icon_e_ugeek.gif', '{L_SMILIES_UBER_GEEK}', 19, 18, 42);
    


    En général, c'est le nombre d'insertions qui est trop gros (par exemple, si un forum a trop de post). Les insertions se font par la commande « INSERT INTO ».

    On peut donc découper l'ensemble des insertions ci-dessus (dernier code)
    comme ceci :

    Code: Tout sélectionner
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':D', 'icon_e_biggrin.gif', '{L_SMILIES_VERY_HAPPY}', 15, 17, 1);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-D', 'icon_e_biggrin.gif', '{L_SMILIES_VERY_HAPPY}', 15, 17, 2);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':grin:', 'icon_e_biggrin.gif', '{L_SMILIES_VERY_HAPPY}', 15, 17, 3);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':)', 'icon_e_smile.gif', '{L_SMILIES_SMILE}', 15, 17, 4);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-)', 'icon_e_smile.gif', '{L_SMILIES_SMILE}', 15, 17, 5);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':smile:', 'icon_e_smile.gif', '{L_SMILIES_SMILE}', 15, 17, 6);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (';)', 'icon_e_wink.gif', '{L_SMILIES_WINK}', 15, 17, 7);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (';-)', 'icon_e_wink.gif', '{L_SMILIES_WINK}', 15, 17, 8);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':wink:', 'icon_e_wink.gif', '{L_SMILIES_WINK}', 15, 17, 9);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':(', 'icon_e_sad.gif', '{L_SMILIES_SAD}', 15, 17, 10);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-(', 'icon_e_sad.gif', '{L_SMILIES_SAD}', 15, 17, 11);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':sad:', 'icon_e_sad.gif', '{L_SMILIES_SAD}', 15, 17, 12);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':o', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 19, 13);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-o', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 19, 14);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':eek:', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 19, 15);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':shock:', 'icon_eek.gif', '{L_SMILIES_SHOCKED}', 15, 15, 16);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':?', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 17);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-?', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 18);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':???:', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 19);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES ('8-)', 'icon_cool.gif', '{L_SMILIES_COOL}', 15, 15, 20);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':cool:', 'icon_cool.gif', '{L_SMILIES_COOL}', 15, 15, 21);
    

    et
    Code: Tout sélectionner
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':lol:', 'icon_lol.gif', '{L_SMILIES_LAUGHING}', 15, 15, 22);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':x', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 15, 23);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-x', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 15, 24);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':mad:', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 15, 25);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':P', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 15, 26);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-P', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 15, 27);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':razz:', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 15, 28);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':oops:', 'icon_redface.gif', '{L_SMILIES_EMARRASSED}', 15, 15, 29);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':cry:', 'icon_cry.gif', '{L_SMILIES_CRYING}', 15, 15, 30);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':evil:', 'icon_evil.gif', '{L_SMILIES_EVIL}', 15, 15, 31);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':twisted:', 'icon_twisted.gif', '{L_SMILIES_TWISTED_EVIL}', 15, 15, 32);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':roll:', 'icon_rolleyes.gif', '{L_SMILIES_ROLLING_EYES}', 15, 15, 33);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':!:', 'icon_exclaim.gif', '{L_SMILIES_EXCLAMATION}', 15, 15, 34);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':?:', 'icon_question.gif', '{L_SMILIES_QUESTION}', 15, 15, 35);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':idea:', 'icon_idea.gif', '{L_SMILIES_IDEA}', 15, 15, 36);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':arrow:', 'icon_arrow.gif', '{L_SMILIES_ARROW}', 15, 15, 37);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':|', 'icon_neutral.gif', '{L_SMILIES_NEUTRAL}', 15, 15, 38);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':-|', 'icon_neutral.gif', '{L_SMILIES_NEUTRAL}', 15, 15, 39);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':mrgreen:', 'icon_mrgreen.gif', '{L_SMILIES_MR_GREEN}', 15, 15, 40);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':geek:', 'icon_e_geek.gif', '{L_SMILIES_GEEK}', 17, 17, 41);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':ugeek:', 'icon_e_ugeek.gif', '{L_SMILIES_UBER_GEEK}', 19, 18, 42);


    NB : Ici ce n'est que découpé en 2, on peut découper en 3, en 4, en 8 ou même à chaque ; si on le désire... (mais seulement si on a du temps à perdre :) pour cette dernière solution)


    C) Un script de découpe SQL ?

    Il existe un script de découpe qui a été fait par Philip Lehmann-Böhm. Celui-ci permet de découper des fichiers sql de sauvegarde en plusieurs morceaux.
    Ce script n'étant pas évident à trouver, il a été rajouté dans nos archives, et vous pouvez le télécharger en cliquant sur le lien ci-dessous pour le télécharger.

    Télécharger le script

    Le script génèrera autant de fichiers sql que nécessaire suivant la taille de découpe que vous avez choisi, et un readme.txt à lire, le tout dans un répertoire.

2) Réinjection
    Il suffit d'aller dans la partie SQL de votre phpmyadmin :

    Image

    De copier chaque partie découpée, de la coller dans la zone de texte et de cliquer sur « envoyer ».

3) Encore des erreurs ?

  • requête SQL: (suivit du code entré) : Dans ce cas, c'est que vous avez découpé ailleurs qu'après un ;
  • Duplicate entry for ... : Vous avez envoyé à phpmyadmin deux fois la même requête :)

    Cette erreur survient notamment si vous découpez de telle manière :
    Code: Tout sélectionner
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':mrgreen:', 'icon_mrgreen.gif', '{L_SMILIES_MR_GREEN}', 15, 15, 40);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':geek:', 'icon_e_geek.gif', '{L_SMILIES_GEEK}', 17, 17, 41);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':ugeek:', 'icon_e_ugeek.gif', '{L_SMILIES_UBER_GEEK}', 19, 18, 42);


    en 2 morceaux (par exemple) comme ça :
    Code: Tout sélectionner
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':mrgreen:', 'icon_mrgreen.gif', '{L_SMILIES_MR_GREEN}', 15, 15, 40);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':geek:', 'icon_e_geek.gif', '{L_SMILIES_GEEK}', 17, 17, 41);

    et
    Code: Tout sélectionner
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':geek:', 'icon_e_geek.gif', '{L_SMILIES_GEEK}', 17, 17, 41);
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':ugeek:', 'icon_e_ugeek.gif', '{L_SMILIES_UBER_GEEK}', 19, 18, 42);


    Dans cette deuxième requête, la ligne
    Code: Tout sélectionner
    INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order)
    VALUES (':geek:', 'icon_e_geek.gif', '{L_SMILIES_GEEK}', 17, 17, 41);
    est exécutée une deuxième fois, donc vous avez une erreur.
  • Le document ne contient aucune donnée : Votre découpe est encore trop grande, découpez en plus petit morceaux

MAJ par Lolovoisn, le 09/10/10 15h21

12/02/2014 - modifié par Geo pour corriger le titre.
Avatar de l’utilisateur
and1hotsauce
Grand-maître des floodeurs
Grand-maître des floodeurs
 
Rédigé le: 11 Fév 2014 à 21:31
Articles: 2
Noter cet article: 123456 Votants: Aucun
Mots-clés: [Doc], Comment, découper, une, sauvegarde, SQL

Retourner vers Développement