I am having a problem backing up a database. I’m moving between vps providers and usually would use the WHM transfer tool. I did it this time also but got database error messages after the transfer and when I compared the 2 databases I noticed that the newer one was 200Mb smaller than the old one n the old server so I have been trying to take a manual backup but I’m having the same problem..
The original database is 1.1Gb. I’ve tried dumping it via command line, exporting from phpmyadmin, cpanel backups etc but each time I`m left with a smaller database.
I have checked both old and new databases, all the tables are backing up fine but its the contents of them which are not fully backing up. which makes me think it may be a timeout issue, .. But I am not 100% sure. I have tried changing settings in php.ini and my.cnf but I am not totally sure what is causing the prob.
Any advice would be greatly appreciated
Related
I have an error with Xampp where it will not connect to my database. I have had this error several times in the past and no solutions have helped. I find that uninstalling and reinstalling ends up being the fastest method, however, by doing so I lose my database tables. As I have no access to the default export and import functions, I was wondering how I transfer the tables across.
Last time, I copied and pasted these files into the same directory when I reinstalled Xampp and the tables transferred but the data within did not. The tables had also lost some functionality as well.
If anyone has any methods to do this I will greatly appreciate it.
The best way to backup and restore your data is to dump the database to an SQL file. You can use the provided mysqldump tool for that, which is the best tool for the job.
Copying the entire MySQL "datadir" (which is probably one level up from the screenshot you've posted) and completely replacing one of your new stopped MySQL instance will probably work, but is not reliable and is not supported. Since there are other files (such as ibdata1) that handle the overall health and functioning of the entire MySQL instance, you can't only copy over individual database directories. Furthermore, you should only do this when the original and replacement MySQL servers/daemons/services are completely stopped because otherwise there are file corruption or concurrency issues.
Since you're running the server on your own computer, you should grant yourself sufficient access to be able to use mysqldump and use that regularly as a backup, since file-level backups of the data directory are not reliable.
I re-installed wampserver 2.5 (with same stuff/settings - nothing changed) and after installation my database got corrupted. Few database tables exist and many of them are not accessible. On right frame it shows No tables found in database.
Even the sidebar of phpmyadmin shows my database table
but when I try to open any table it says:
To confirm whether tables exists in database, I go to
C:\wamp\bin\mysql\mysql5.6.17\data\db_blog
where I can see a long list of stuff. My tables are listed in 2 different formats frm and idb.
How can I repair my database? Please help me.
Before reinstalling wamp you should have done backup of database and after reinstall bring database back from backup. If after reinstall of wamp database is still available but seems to be corrupted then there you did something wrong with wamp reinstall as database should be purged or not touched, nothing in between. Now everything depends on what you want to achieve: you can purge databases simply using phpmyadmin or try to somehow restore database but it is possible only if you have backup of database, otherwise data is corrupted and can't be restored. You may try to repair database by following this article but do not expect miracles:
https://www.a2hosting.com/kb/cpanel/cpanel-database-features/optimizing-and-repairing-mysql-databases-with-phpmyadmin
I'm working on a Wordpress site and accidentally ended up modifying the Database via PHPMyAdmin in a way that affected all the posts on the website negatively. I regret the fact that I should have manually made a DB backup before working on it. After having tried to resolve it by importing the original data I had at first, I seem to have lost more data than I anticipated. Is it possible to restore the Cloud9 MySQL Database to a specific data and time in the past?
I am using Workbench to export a database stored on my hoting providers server, will the server experience any downtime whilst I am exporting the data?
The only reason I ask is because when I back up my local SQL database my server needs to be switched offline for it to work.
All comments will be much appreciated.
Ben
No it will not cause a downtime, unless your server has really low resources (in which case you should find a better hosting). Seriously though, nothing bad will happen.
Also I can hardly imagine why you need to disable your localhost for backup... Workbench uses mysqldump for exports and this in turn needs MySQL to be online...
I needed to re-install my computer but I didn't think about exporting the data from mysql 5.
How do I get the data from the old installation into the new installation, is this just copying the data directory or do I have to take other steps to get to the data?
For MyISAM tables you can generally get away with copying them across. (Whilst the server's stopped, obviously.) For InnoDB, it can work, but you'll have to have the same basic block size settings. If you can use the same major version of MySQL and the same my.cnf you stand a good chance of having it work.
Afterwards it's a good idea to ensure the tables are rebuilt (eg. using ALTER TABLE), and make a note to mysqldump properly next time because none of this is supported or guaranteed to work!
I would export your data as a sql file from mysql (ie: with phpmyadmin) and then import it into the new installation. Your db should be built and filled with data pretty easily.
You said that you "didn't think about exporting the data". Does that mean you don't have access to the old installation any more?