phpMyAdmin & MySQL, pt. 3
Now that you have a backup of your database, how do you import it in case of data loss/corruption? That question will be answered here and it’s easier than you may think.
These steps can be used for importing any SQL file through phpMyAdmin. To perform an import of your SQL file:
- Connect to your phpMyAdmin site.
- In the left pane, click the name of the database.
- In the right pane, click the tab labeled SQL.
- You should see a text box under Location of the text file:. Click the Browse button.
- Browse to the SQL file you wish to import.
- The file may end in .sql, .sql.zip, .sql.gz or .sql.bz. It depends on what compression type you chose during the backup of your database.
- If your file is larger than the allowed size, you will have to break it apart by using a text editor to transfer some of the SQL query to another text file. The new text file would need to be saved with the .sql extension.
- Under Compression:, leave it set to Autodetect.
- The Character set of the SQL file needs to be set to what type of encoding you are using on the database. Unless you changed it from the default, leave it set to utf8.
- Click the Go button. Import time depends on the speed of your connection and the size of the SQL file.
If you are running your own web server, and the file size limit for the import file is showing 2,048 KB (2MB), you can increase by changing a setting in your php.ini file. The setting you want to change is upload_max_filesize. By default, it is set to 2M. Some web host have set the limit between 2 and 8 MB (8M).
What do you do if you get an error? As much as I’d like to have info on every error listed for your quick search, it’s not happening. There is just too much that can go wrong to be able to really be effective in writing it up. You can ask me about it (in the comments section) or go to either TechDiscussions or Computer Help Forum, create an account and ask away. Whichever way you choose, you’ll get the help you need.
20.Aug.05
Tech Tip, phpMyAdmin
You can leave a response, or trackback from your own site.























Hi,
I did what you said for the upload_max_filesize. I put 20M but it still gives me the 2M limit. What is the problem?
What is the value you have for post_max_size?
I don’t have that line! Can I insert it anywhere in the php.ini?