Moving My Site.

computerguy2003

New Member
Hey Guys, I am about to move my site to a new host. I am about to export the database. Is there anything special I should know, before doing this.

I get this error " MySQL said: Documentation
#1044 - Access denied for user 'lwminy'@'localhost' to database 'db251288436' "
 
Backing Up & Restoring a MySQL Database using phpMyAdmin / SSH
=======================================================

This is just a short mini-tutorial explaining how to backup parts of the mySQL database using phpMyAdmin and also via SSH (Secure Shell) access. This tutorial should be of use to most people, as it's an important part of any website/forum maintenance.

So, let's get started...

Step 1 - Backing up using phpMyAdmin

Note: Most good hosts provide phpMyAdmin (mySQL administration). If you do not know where it is or even if it exists on your server, just get in touch with your host.

1. Login to phpMyAdmin.
2. Select the database you wish to use.
3. On the navigation bar on the top, select "Export" (besides SQL, Structure, Search, Query... etc.)
4. You should now be presented with a nifty little page which shows all the tables in the database, SQL Options and Save Types. *
5. To backup the whole database, click "Select All" under the list of tables in the page.
6. To backup a selected few, just hold down CTRL on your keyboard and select the tables you wish to backup (release the key when all selecting is done).
7. SQL Options can be left as default, but I suggest ticking the "Add DROP TABLE" option as if you are restoring a backup on a database that already exists and has the table in it - you will get a lot of errors! This way, by ticking the "Add DROP TABLE" option you will avoid the errors. For more information on the options just click the little "?" icon after SQL Options.
8. If you want to save the backup as a file (recommended) then tick "Save as file" - Leave file name as is or edit for your needs. Select "gzipped" as compression. Now click "Go". If asked, choose "Save to disk" and save it wherever on your computer (it may take sometime depending on the size).
9. If you want to show the whole backup SQL on your browser window, don't tick "Save as file" - once you have selected the tables you wish to backup (explained in step 5/6) click "Go". The page will now change and should show the SQL information (it may take sometime depending on the size). Copy and paste it to a text file or do whatever you want with it!

Note: Yes, the tables of the database will be shown to the far left in a frame, but they will also be displayed in a different form on this new page to the right in phpMyAdmin.

Congratulations! You have successfully backed up your database / selected tables!

Step 2 - Restoring your database using phpMyAdmin

Note: Most good hosts provide phpMyAdmin (mySQL Administration). If you do not know where it is or even if it exists on your server, just get in touch with your host.

1. Login to phpMyAdmin.
2. Select the database you wish to use.
3. On the navigation bar on the top select "SQL" (besides Export, Structure, Search, Query... etc.)
4. You should now be presented with a little page which allows you to run SQL query/queries on the database, either by inputting the query/queries to the input box or by locating a text file on your computer.
5. You now have 2 options: 1) Paste the SQL which you backed up earlier in the "Input Box" and click "Go" or 2) If you saved the file on your PC then use the option below the first one; Click Browse > Locate the File > Click "Go". (Note: Most servers set a "Max File Size" for uploading the SQL, the size appears beside the Browse button.)
6. It may take sometime for the file to be uploaded and fully run, so give it a chance. Once it worked, it will bring you back to the same page and should confirm if all went well "Your SQL-query has been executed successfully: The content of your file has been inserted."

Congratulations! If all went well, you have successfully restored your backed up database!

Step 3 - Backing up using SSH

Note: Some hosts do not offer SSH access, I suggest contacting your host and asking him/her if SSH access is enabled and if so the details. A good program to use for connecting via SSH is PuTTY (Get it at: PuTTY: a free telnet/ssh client). Don't know how to use it? Search on Google for a tutorial.

1. Connect to your host via SSH, login and run: mysqldump --opt -u user -p dbname > {path}/backup.sql
2. You will be asked to type out your password once you run that command, do so and click enter. It may take some time for it to respond, but once completed you should be brought back to where you started (bash/command line).

Congratulations! You successfully backed up your database using SSH.

Step 4 - Restoring using SSH

Note: Some hosts do not offer SSH access, I suggest contacting your host and asking him/her if SSH access is enabled and if so the details. A good program to use for connecting via SSH is PuTTY (Get it at: PuTTY: a free telnet/ssh client). Don't know how to use it? Search on Google for a tutorial.

1. Connect to your host via SSH, login & run: mysql -u user -p dbname < {path}/backup.sql
2. You will be asked to type out your password once you run that command, do so and click enter. It may take some time for it to respond, but once completed you should be brought back to where you started (bash/command line).

Congratulations! You have successfully restored your database using SSH.
 
here is another way through bigdump, perhaps the easiest and effective way ;)

SUPPORT

* Need help restoring or moving the large mySQL database?
* Need help converting your dump file to use BigDump?
* Need help developing new software that use BigDump?
* Need a feature that BigDump doesn't currently provide?
* Need help getting BigDump running?
* Need a bug fixed right away?
* Need someone you can ask if you run into a problem?

Support services for BigDump can provide the solution you need. For more information please contact me.

YOU WANT

To restore the very large backup of your mySQL database (or a part of it) into the new or the same mySQL database. You can't access the server shell and you can't import the dump using phpMyAdmin or any other scripts due to hard memory resp. runtime limit of the web server.

YOU NEED

1. Bigdump script bigdump.php from the download above
2. Dump file(s) of your database created by phpMyAdmin I'll call it dump.sql from now on. You can also use GZip compressed dump files if you call them somehow like dump.gz. GZip support is only with PHP 4.3.0 and later
Note: Using a huge GZip compressed dump file can cause the script to exceed the PHP memory/runtime limit since the dump file has to be unpacked from the beginning everytime the session starts. If this happens use the uncompressed dump. It's your only chance.
3. Access account for your mySQL database
4. Access account for some web server with PHP 4.1.0 or later installed. This web server must be able to connect to the mySQL database (this ability is probably present if your web server and the mySQL server are from the same ISP)
5. Some text editor like Notepad to edit the configuration file
6. Some FTP client to upload the files to the web server
7. Common knowledge about files, PHP, mySQL databases, phpMyAdmin, FTP and HTTP

USAGE

1. Open bigdump.php in a text editor and adjust the database configuration
2. Drop the old tables on the target database if your dump doesn't contain "DROP TABLE" (use phpMyAdmin)
3. Create the working directory (e.g. dump) on your web server
4. If you want to upload the dump files directly from the web browser give the scripts writing permissions on the working directory (e.g. make chmod 777 on a Linux based system). You can upload the dump files from the browser up to the size limit set by the current PHP configuration of the web server. Alternatively you can upload any files via FTP.
5. Upload bigdump.php and the dump files (*.sql or *.gz) via FTP to the working directory (take care of TEXT mode upload for bigdump.php and dump.sql but BINARY mode for dump.gz if uploading from MS Windows).
6. Run the bigdump.php from your browser via URL like http://www.yourdomain.com/dump/bigdump.php. Now you can select the file to be imported from the listing of your working directory.
7. BigDump will start every next import session automatically if you enable the JavaScript in your browser.
8. Relax and wait for the script to finish. Do not close the browser window!
9. IMPORTANT: Remove bigdump.php and your dump files from your server

Note 1: BigDump will fail processing large tables containing extended inserts. An extended insert contains all table entries within one SQL query. BigDump isn't able to split such SQL queries. In most cases BigDump will stop if some query includes to many lines. But if PHP complains that allowed memory size exhausted or MySQL server has gone away your dump probably also contains extended inserts. Please turn off extended inserts when exporting database from phpMyAdmin.

Note 2: Some web servers disallow script execution in the directory with writing permissions for security reasons. If you changed the permissions on the working directory and you are getting a server error when running the script restore the permissions to their normal state for directories.

Note 3: If Timeout errors still occure you may need to adjust the $linespersession setting in bigdump.php.

Note 4: If mySQL server overrun occures you can use $delaypersession setting to let the script sleep some milliseconds or more before starting next session. This setting will only work if the JavaScript is activated.

Note 5: BigDump is currently not able to restore a single dump file with multiple databases inside (switched by the USE statement).

Note 6: If you experience problems with non-latin characters while using BigDump you have to adjust the $db_connection_char_set configuration variable in bigdump.php to match the encoding of your dump file.
 
Error

SQL query:

CREATE DATABASE `db251288436` ;

MySQL said: Documentation
#1044 - Access denied for user 'lwminy'@'localhost' to database 'db251288436'
 
tha's why i use mysql dumper it does the backups it restore the backups xD it also makes coffe <-<U ok i'm kidding, if you still have access to the old host search in the forum for mysqldumper it will do everything for you
 
Back
Top