Sunteți pe pagina 1din 5

Re: move database from one PC to another Posted by: southbeach (---.not.

configured) Date: March 13, 2008 10:04PM To export: 1) 2) 3) 4) 5) 6) Click on WAMP systray icon Choose phpMyAdmin Select database off drop-down list Click database name on left hand pane Click export tab Scroll down and click Go

Normally, this comes up set to SQL by default, but just in if in case, before yo u click GO 7) Copy the query code generated All that remain is to run this query at target computer; so, find a way to get t his text there 8) Once you have copied text/query in new computer 8a) Open phpMyAdmin 8b) Make sure you have the database in new computer. If not there, create it 8c) Click on the database 8d) Click on import 8e) Select SQL and click GO 8f) Follow prompts ... You could also select the database, click SQL Query, paste the SQL Code and watc h it create all the tables NOTE: Do not attempt the latter if you have large files .... Hope this helps! ------------------------BAckup Mysql database How Do I Back Up My MySQL Database in WAMPServer2? By Craig Witt, eHow Contributor How Do I Back Up My MySQL Database in WAMPServer2? thumbnail Backing up your WAMPServer 2 MySQL database is quick and simple. WAMPServer 2 is a free, open-source utility that allows developers to easily dep loy common website management tools using the Microsoft Windows operating system . In addition to automatically installing and configuring Apache HTTP Server, My SQL and PHP, WAMPServer also installs the phpMyAdmin and SQLiteManager programs. Because it operates using the Windows interface, backing up MySQL databases man aged by WAMPServer is quick and easy. Other People Are Reading How to Install WampServer 2.0i & WordPress How to Export a MySQL Database Print this article Instructions 1

Locate your MySQL database. Open your WAMPServer root folder, located at C:\wamp by default. Next, open the following sub-folders: "bin," "mysql," "mysq lx.x.x" (where x.x.x stands for your MySQL version number) and then "data." With in the data folder you will see all of the MySQL databases created with WAMPServ er. 2 Copy the folder containing your database. Locate the folder name that ma tches the name of your database. Right-click the folder and select "Copy." 3 Create the backup of your database. Choose the location where you want t o store your back-up database, perhaps a separate folder or on a CD. After selec ting the location, right-click within the folder window and select "Paste." The back-up copy of your MySQL database has been created Read more: How Do I Back Up My MySQL Database in WAMPServer2? | eHow.com http:// www.ehow.com/how_5981373_do-up-mysql-database-wampserver2_.html#ixzz1rYLUtvsV -------------How to restore MySQL database from sql dump file? advertisement mysql, mysql database, sql database, sql, database server, server, sql database server, mysql database server There are 2 ways to restore your MySQL database from sql dump file. 1st way to restore mysql database from sql dump file is using mysql web control panel phpMyAdmin - Log into phpMyAdmin. - Select your preference database on the left database navigation drop down list . Click on Import tab on the top. Select your sql dumb file at File to import Then select your mysql database charset (ex: Latin1, utf-8) and click GO and it s done!

Do not use phpMyAdmin to import or restore your MySQL database if your MySQL dat abase file is large. This is because, phpMyAdmin has limit on total upload size which depend on php setting. Besides, there is also maximum execution time which may cause browser to time out. The solution to restore large mysql database from sql dump file is using unix/li nux shell command. To restore mysql database from a dump file, just type the command below:mysql -u #username# -p #database# < #dump_file# Of course you need to replace #username# to your database username and #database # to your target database. and rename #dump_file# to your dump file file name (E x: dump.sql) Once you enter the command, the linux/unix shell will prompt you fo r your database user password, just key in your database password and you are do ne. ----------------

Restore MySQL database from a backup file There are many reasons you would want to restore a database from a backup file Bu t you should also test this on a test server just to make sure that your databas e backups are working correctly. Here s the syntax: mysql -h hostname -u username -pthepassword databasename < dumpfile.sql Here s an example: mysql -h localhost -u root -p72aDufi8 db01 < thedumpfile.sql

-------------------How to Back Up and Restore a MySQL Database Print If you're storing anything in MySQL databases that you do not want to lose, it i s very important to make regular backups of your data to protect it from loss. T his tutorial will show you two easy ways to backup and restore the data in your MySQL database. You can also use this process to move your data to a new web ser ver. Back up From the Command Line (using mysqldump) Back up your MySQL Database with Compress Restoring your MySQL Database Backing Up and Restoring using PHPMyAdmin Back up From the Command Line (using mysqldump) If you have shell or telnet access to your web server, you can backup your MySQL data by using the mysqldump command. This command connects to the MySQL server and creates an SQL dump file. The dump file contains the SQL statements necessar y to re-create the database. Here is the proper syntax: $ mysqldump --opt -u [uname] -p[pass] [dbname] > [backupfile.sql] [uname] Your database username [pass] The password for your database (note there is no space between -p and the password) [dbname] The name of your database [backupfile.sql] The filename for your database backup [--opt] The mysqldump option For example, to backup a database named 'Tutorials' with the username 'root' and with no password to a file tut_backup.sql, you should accomplish this command: $ mysqldump -u root -p Tutorials > tut_backup.sql This command will backup the 'Tutorials' database into a file called tut_backup. sql which will contain all the SQL statements needed to re-create the database. With mysqldump command you can specify certain tables of your database you want to backup. For example, to back up only php_tutorials and asp_tutorials tables f rom the 'Tutorials' database accomplish the command below. Each table name has t o be separated by space. $ mysqldump -u root -p Tutorials php_tutorials asp_tutorials > tut_backup.sql Sometimes it is necessary to back up more that one database at once. In this cas e you can use the --database option followed by the list of databases you would like to backup. Each database name has to be separated by space.

$ mysqldump -u root -p --databases Tutorials Articles Comments > content_backup. sql If you want to back up all the databases in the server at one time you should us e the --all-databases option. It tells MySQL to dump all the databases it has in storage. $ mysqldump -u root -p --all-databases > alldb_backup.sql The mysqldump command has also some other useful options: --add-drop-table: Tells MySQL to add a DROP TABLE statement before each CREATE T ABLE in the dump. --no-data: Dumps only the database structure, not the contents. --add-locks: Adds the LOCK TABLES and UNLOCK TABLES statements you can see in th e dump file. The mysqldump command has advantages and disadvantages. The advantages of using mysqldump are that it is simple to use and it takes care of table locking issues for you. The disadvantage is that the command locks tables. If the size of your tables is very big mysqldump can lock out users for a long period of time. Back up your MySQL Database with Compress If your mysql database is very big, you might want to compress the output of mys qldump. Just use the mysql backup command below and pipe the output to gzip, the n you will get the output as gzip file. $ mysqldump -u [uname] -p[pass] [dbname] | gzip -9 > [backupfile.sql.gz] If you want to extract the .gz file, use the command below: $ gunzip [backupfile.sql.gz] Restoring your MySQL Database Above we backup the Tutorials database into tut_backup.sql file. To re-create th e Tutorials database you should follow two steps: Create an appropriately named database on the target machine Load the file using the mysql command: $ mysql -u [uname] -p[pass] [db_to_restore] < [backupfile.sql] Have a look how you can restore your tut_backup.sql file to the Tutorials databa se. $ mysql -u root -p Tutorials < tut_backup.sql To restore compressed backup files you can do the following: gunzip < [backupfile.sql.gz] | mysql -u [uname] -p[pass] [dbname] If you need to restore a database that already exists, you'll need to use mysqli mport command. The syntax for mysqlimport is as follows: mysqlimport -u [uname] -p[pass] [dbname] [backupfile.sql] Backing Up and Restoring using PHPMyAdmin It is assumed that you have phpMyAdmin installed since a lot of web service prov iders use it. To backup your MySQL database using PHPMyAdmin just follow a coupl e of steps:

Open phpMyAdmin. Select your database by clicking the database name in the list on the left o f the screen. Click the Export link. This should bring up a new screen that says View dump of database (or something similar). In the Export area, click the Select All link to choose all of the tables in your database. In the SQL options area, click the right options. Click on the Save as file option and the corresponding compression option an d then click the 'Go' button. A dialog box should appear prompting you to save t he file locally. Restoring your database is easy as well as backing it up. Make the following: Open phpMyAdmin. Create an appropriately named database and select it by clicking the databas e name in the list on the left of the screen. If you would like to rewrite the b ackup over an existing database then click on the database name, select all the check boxes next to the table names and select Drop to delete all existing table s in the database. Click the SQL link. This should bring up a new screen where you can either t ype in SQL commands, or upload your SQL file. Use the browse button to find the database file. Click Go button. This will upload the backup, execute the SQL commands and r e-create your database.

S-ar putea să vă placă și