Powered by Invision Power Board


  Reply to this topicStart new topicStart Poll

> MySQL
Elijah
Posted: Dec 10 2007, 04:37 AM
Quote Post





Group: Members
Posts: 6
Member No.: 1,569
Joined: 20-November 07



Trying to upgrade my Drupal installation by making a test site in a sub-folder. I have backed up my files and have backed up my MySQL database described here. Backing up your site (GUI) using phpmyadmin. Then I try as it says Copy your live site to a test site (GUI). When I click go I get the following error.


Error

MySQL said:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1' at line 1

How do I backup my database to a test database?
PMEmail PosterUsers Website
Top
Matt
Posted: Dec 11 2007, 01:22 PM
Quote Post





Group: Members
Posts: 1,103
Member No.: 342
Joined: 25-November 03



The backup and restore procedures that are outlined in the instructions given on DruPal's site are correct. PHPMyAdmin's backup and restore procedures will usually work for small, simple databases but will sometimes result in errors for larger, more complex databases. In those cases, I recommend using the MySQL command line utilities for backup and restore.

To backup and restore using the MySQL command line utilities you will need to log into your VPS using a secure shell (SSH) application, such as Putty.

To back up a database, use the following command:

CODE
mysqldump -u username -p databasename > dumpfile.sql


To import a MySQL dumpfile into a database use the following command:

CODE
mysql -u username -p databasename < dumpfile.sql


In the above examples, replace "username" with the name of the MySQL user that has access to the database. Replace "databasename" with the name of the already-existing database. Replace "dumpfile" with the name of your backup file. When creating a MySQL dump file, I usually like to name the dump file the same name as the database to reduce confusion.

When executing the above commands, you will be prompted for the database user "username's" password.


--------------------
Matt B.
Advantagecom Technical Support

Private messages are ignored unless solicited. If you have a support question, please email support@advantagecom.net, post in the appropriate section of the forum, or call if your service plan allows support by phone.
PMUsers Website
Top
Elijah
Posted: Dec 15 2007, 04:37 AM
Quote Post





Group: Members
Posts: 6
Member No.: 1,569
Joined: 20-November 07



This worked like a charm and my Drupal upgrade went well thank you!
PMEmail PosterUsers Website
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll