Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
How do I transfer MySQL databases with PHPMyAdmin? Error.
Old 09-10-2009, 05:59 PM Re: How do I transfer MySQL databases with PHPMyAdmin? Error.
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
ok...
Just a suggestion.
I see that you have an entry "mysql databases" in your control panel.
Try to go there, and create the database manually.

Then, edit the sql file dump, and remove the line
Code:
CREATE DATABASE `soldatbo_smf` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
and then retry to send the dump.

Basically, you will create the db yourself, and not let the script do it.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
 
Register now for full access!
Old 09-11-2009, 03:58 AM Re: How do I transfer MySQL databases with PHPMyAdmin? Error.
Novice Talker

Posts: 14
Trades: 0
Thanks. How will it know which database to import it into?
miketh2005 is offline
Reply With Quote
View Public Profile
 
Old 09-11-2009, 05:04 AM Re: How do I transfer MySQL databases with PHPMyAdmin? Error.
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
You don't care about that.
I you look at the line after "create table", it says "USE `soldatbo_smf`;"

The script will simply try to connect to the db with that name with the current user.
Maybe it will fail, because of the user grants (create table, create indexes...) but try it anyway.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 09-11-2009, 05:32 AM Re: How do I transfer MySQL databases with PHPMyAdmin? Error.
Novice Talker

Posts: 14
Trades: 0
Import has been successfully finished, 129 queries executed.

YAY! IT WORKS! After all that! Thanks ALOT man! Your great! I don't know how to repay you! Thanks! It's weird that it 0.8 MB LESS, though...

But, I might need more help with my forum. Do I just transfer ALL of public_html over? Do I have to change anything?
miketh2005 is offline
Reply With Quote
View Public Profile
 
Old 09-11-2009, 06:10 PM Re: How do I transfer MySQL databases with PHPMyAdmin? Error.
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
YAY! IT WORKS!
:-D

Quote:
But, I might need more help with my forum. Do I just transfer ALL of public_html over?
Without knowing your file structure, I'd say that yes, you have to copy everything that was in the root folder of your old host in the root of the new one.
Quote:
Do I have to change anything?
Normally, you should not, I think.
But this require testing.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 10-03-2009, 01:05 AM Re: How do I transfer MySQL databases with PHPMyAdmin? Error.
freezea's Avatar
Experienced Talker

Posts: 45
Trades: 0
Hi, miketh.

This is a list of methods alog with a description and howto for each method as well as advices about when to use each method.
  1. phpMyAdmin. For this example I used php phpMyAdmin 2.9.1. Older versions may be a little different.
    Export your database: Go in phpMyAdmin, select your database and go to Export tab. You should see a set of options, by default both data and structure should be checked so your export will contain the database structure and the actual data in the database. You can also pick the format of your export ( sql, csv, pdf, xml ...etc). For transferring the database you should use the SQL format. At the bottom of the page there should be a for that will let you specify the file name, and compression. If you select "none" the export will be dumped in your browser, this is not recommended because you would have to copy that sql and then paste it in phpMyAdmin on the new server and if the dump is large it may not work.
    Import the database on the new server: Click on the SQL button in the left sidebar in phpMyAdmin. In the pop up window that just showed up go to "Import files" tab. In there you will be able to import the sql file you get from your first server.The problem with the phpMyAdmin approach is that most web server configurations limit the maximum size of files you upload or the maximum execution time of a php script or the maximum memory that a PHP script can use. So unless you have small dumps ( 1-10 mb ) this method is not recommended.
  2. command line mysql client tools: if you have shell access to any of the servers ( ssh or telnet ) you can use the command line mysql client to either export (dump ) or import a mysql database .
    To dump the database use mysqldump:
    mysqldump -u "your_username" -p --lock-tables \\"your_database" > your_database_dump.sqlI added --lock-tables there so that it puts a read lock on all tables while running the dump process to make sure that no one can modify the databases and create inconsistencies in the dump.
    If you have more then one database that needs to be exported you can use the --databases option like this:
    mysqldump -u "your_username" -p --lock-tables \\--databases DB1 [DB2 DB3...] > your_database_dump.sqlIf you want to export all of your databases you can just replace --databases DB1 [DB2 DB3...] with --all-databases
    To import the databases on the new server you can try the phpMyAdmin method or if you have shell access (preferable ) you can use the mysql client. If you're going to use the mysql client you will have to transfer the dump file to the server ( use ftp or sftp/scp ).You might want to compress the file before transferring it
    bzip2 your_database_dump.sqlscp your_database_dump.sql.bz2 user@newserver:~and after the transfer finished, run this on the new server:
    mysql -u "your username" -p "your_database" < database_dump.sql
    or if your dump includes a "CREATE DATABASE" statement ( usually when a file contains the dump of more then one database or if you exported you databases using --all-databases or --databases options ) then you can just do: mysql -u "your_username" -p < your_database_dump.sql
    This method works with very large databases.
  3. other tools:
    The MySQL server stores database structure and data in regular files on disk. This means that if you can login on the server with privileges to access the folder where the databases are stored ( usually /var/lib/mysql ) then you can just copy or transfer then to another server using tools like ftp, scp, sftp, rsync. Before you use any of those tools you have to make sure no one is writing to the databases that you want to transfer so you should put a read lock on them. If you want to lock a table you will have to use the MySQL client to login to your MySQL server and then just type in :
    LOCK TABLE table_name READ[, table_name2 READ, ...]or if you want to lock all tables on the server:
    FLUSH TABLES WITH READ LOCKleave the mysql client running and then copy or transfer transfer the files. After the transfer finished, exit the mysql client or type:
    UNLOCK TABLESto release the read lock.
    This method also works with large databases, and it is faster then the previous method in this case MySQL server does not have to parse and process queries or recreate indexes because the whole data including indexes is transferred from the old server.
__________________

Please login or register to view this content. Registration is FREE
: Web-based Excel-like Java reporting tool.
freezea is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How do I transfer MySQL databases with PHPMyAdmin? Error.

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18546 seconds with 11 queries