I'm unable to restore my site database and need help figuring out why. The Wordpress site is on my local computer.
Here's what I did:
• Exported the backup file in a zip format
• Made updates to plugins through Wordpress platform
• Site crashed from bad update; tried to delete that plugin and made things worse
• Decided to restore backup; tried importing through phpmyadmin; came back with errors
• Dropped all the tables from that database
• Unzipped by backup file; commented out "create database" line
• Tried importing again and came up with the following errors:
#1007 - Can't create database 'Wordpress'; database exists
I've built several websites locally in the past so yes, there's already another database called Wordpress. I'm not sure how to delete them besides dropping the tables.
I'm losing hope that I'll ever be able to restore this site.
Any insight?
To import your database,
open it with your text editor like NotePad++
locate (should be at the beginning of the file) and erase the line:
"CREATE DATABASE yourdbname"
Save it
Now try to import it again
Also, it seems like you have only one database called Wordpress and you're using it for all your websites, right? You should make a unique name, for each database/site you create. You can still do that for your current site and create a new database, import your tables, and edit your wp-config.php file to communicate with the new database.
Related
I am using xampp to host my website local. I am making a WordPress site with the MySQL database from xampp.
Now, I bought a new computer and took backup of my WordPress folder. Now when I try to open my WordPress site on my new computer, I get the error: Error establishing a database connection
I can image this is because the database that is linked to the WordPress site is not on my new system.
I formatted my old drive so I cannot restore the old database. Is there a work around?
If you have your old database file (.sql) then you can just
Run this link from your browser http://localhost/phpmyadmin.
Select Database which you want to upload the SQL file. (If no DB , create new database).
Click on Import option from top menu section and upload you files.
and for taking backup of your database on Xampp
1. Run this link from your browser http://localhost/phpmyadmin.
2. Select Database which you want to take backup of.
3. Click on Export option from top menu section and backup your files.
If your old drive is completely formatted, and you weren't using any sort of Wordpress backup plugin, then no, you won't be able to rebuild the site. Sorry! As well as storing your content (posts / articles), your Wordpress database also stores information on which plugins you were using, so it is an critical part of rebuilding any Wordpress site.
Next time around, you should export your database to a file (eg .sql), so you can import it on your new server/laptop. You would achieve this by either using a Wordpress plugin, or on XAMPP by using phpMyAdmin. You could also do this with 3rd party apps, like SequelPro or MySQLWorkbench.
You should have your images and static assets saved - eg css files, uploaded images, so you have something to start with, if you decide to rebuild your site without the database.
You need to install your wordpress site again with new database. You already lost it. Always backup your wordpress site.
You can backup your wordpress site with this plugin and it's free-
https://wordpress.org/plugins/updraftplus/
Thanks
BanyanTheme
Step 1: Backup your database on the old computer.
Step 2: Restore the database onto the new computer.
Step 3: Run file install in wordpress
Good luck!
I have been working on a web application using ExtJS with a SQL Database hosted on phpMyAdmin using MAMP. About 2 weeks ago, I had to dump my old HD because of bad sectors and I got an SSD as a replacement. After installing my applications again (IDE's, Document Editing Softwares, MAMP, etc), I had to reinitialize my databases in phpMyAdmin.
Luckily, I had one of them online in production so I just exported the SQL from the server and I had a local copy again. However, there's this one other website that I do not have a backup to the SQL file of -- and I need to get that SQL file because I can't create it from memory (I think it had 30+ tables already).
I know I can plug in my old hard drive, boot from there, open MAMP, open phpMyAdmin, then export my database. However, that's too much work and I am not sure if that's a good idea.
Is there a way to extract the SQL file of a phpMyAdmin table by using the file directory/structure alone? I think MAMP is supposed to store the data somewhere so that phpMyAdmin knows where to get its SQL tables.
Update
I found my "database" under /Applications/MAMP/db/mysql/ProjectName/ but they're .frm and I'm clueless on how to open this.
Take a look at this answer: Restore the mysql database from .frm files
You'll need a couple more files other than the .frm, but you can solve it with the files alone, no need to plug in your old drive again.
I removed all tables from my WP database and imported .sql file from another exported database. When I access website it started installing WordPress and after installation none of my imported post are visible. What I have done wrong?
There are few things to consider when moving databases from one site to another..
check wp_config file so it uses the correct information
once database in imported, ensure your siteurl and home option_name entries point to the correct address in wp_options table
permanalinks are updated
you have all plugin/theme files in place
I recently installed a new version of XAMPP. I copied and pasted database folders from the old xampp's mysql/data to the same folder in the newer version. The database names are displayed in phpMyAdmin but it does not show any data.
I know I can do a simple import/export sql to resolve this but I'd like to know why copying and pasting the database folders not working? Do I have to do something else in order to make this work?
I'm going to backup my database regularly using an auto backup tool. Apart from backing up mysql/data folder, do I also need to backup some other folders or files to have a proper database backup?
why copying and pasting the database folders not working? >> as far as I know we need to use import feature, because it will register the database to mysql's infomation_schema.
So even if the database file is stored in the correct folder, it won't show up on the phpmyadmin because it's not registered. And I think mysql didn't do any directory scanning to determine it's database line up.
To back up automatically, there are several ways you can do. Moreover if you use linux OS, you have more freedom to do that, for example create a php script to backup your db and then execute it regulary by using cron job.
hope this can help you.
I am working on a charity site and was tasked with moving a WordPress site to another host from Yahoo hosting. I have done this before and thought it would be easy enough.
Before moving the site I backed up all the files and backed up the database. The files are fine, but the database backup has me stumped.
I ended up with the following file: mysqldata.2009-09-20-18-37.tar.gz
I thought I was in good shape and could just import the file using PHPmyAdmin, however, when I unzipped the file it is not a sql file at all but has the following structure:
blog
mysql
Within the mysql director it has a list of files like this:
user.MYI
columns_priv.frm
columns_priv.MYD
columns_priv.MYI
db.frm
db.MYD
db.MYI
func.frm
func.MYD
func.MYI
host.frm
host.MYD
host.MYI
tables_priv.frm
tables_priv.MYD
tables_priv.MYI
user.frm
user.MYD
Is there some way I can restore the database with the information in this form?
Thanks!
On your new database server, create the new database, e.g. CREATE DATABASE my_wordpress_blog
Copy these .MYI, .MYD and .frm files to wherever MySQL stores the files for this database, e.g. /var/lib/mysql/my_wordpress_blog/
This will probably only work if the version of MySQL on your new server is the same or newer than your old server.
Hy if you have shell acces to the server just do
`mysqldump db_name backup-file.sql`
And restore the db in phpmyadmin.
Might also consider using the WordPress Tools->Export at the old blog and Tools->Import->WordPress at the new blog.
Or installing a plugin that will create a backup you can restore from within phpMyAdmin.
http://wordpress.org/extend/plugins/wp-db-backup/