database-backups

Is copying /var/lib/mysql a good alterntive to mysqldump?

我的未来我决定 提交于 2019-11-28 07:12:58
Since I'm making a full backup of my entire debian system, I was thinking if having a copy of /var/lib/mysql directory is a viable alternative to dumping tables with mysqldump. are all informations needed contained in that directory? can single tables be imported in another mysql? can there be problems while restoring those files on a (probably slightly) different mysql server version? Yes Yes if the table is using the MyISAM (default) engine. Not if it's using InnoDB. Probably not, and if there is, you just need to execute mysql_upgrade to fix them To avoid getting databases in a inconsistent

Minimum GRANTs needed by mysqldump for dumping a full schema? (TRIGGERs are missing!!)

荒凉一梦 提交于 2019-11-28 03:32:01
I have a MySQL user called dump with the following perms: GRANT USAGE ON *.* TO 'dump'@'%' IDENTIFIED BY ... GRANT SELECT, LOCK TABLES ON `mysql`.* TO 'dump'@'%' GRANT SELECT, LOCK TABLES ON `myschema`.* TO 'dump'@'%' I want to dump all data (included triggers and procedures) using the dump user. I call mysqldump in the following way: mysqldump -u dump -p --routines --triggers --quote-names --opt \ --add-drop-database --databases myschema > myschema.sql Everything is OK with the dumped file except for the triggers, they are missing !! The triggers are dumped correctly if I try mysqldump with

How to take MySQL database backup using MySQL Workbench?

北慕城南 提交于 2019-11-28 02:49:44
How to take database backup using MySQL Workbench? Can we take backup in the following ways- Backup file(.sql) contains both Create Table statements and Insert into Table Statements Backup file(.sql) contains only Create Table Statements, not Insert into Table statements for all tables Backup file(.sql) contains only Insert into Table Statements, not Create Table statements for all tables For Workbench 6.0 Open MySql workbench. To take database backup you need to create New Server Instance (If not available) within Server Administration . Steps to Create New Server Instance : Select New Server

Why is my database backup script not working in php?

浪子不回头ぞ 提交于 2019-11-27 22:29:08
I am using the Database Backup script by David Walsh( http://davidwalsh.name/backup-mysql-database-php ) to backup my MYSQL database as a .sql file to my server. I created a user named backup and gave it all privileges(just to make sure). Then I put the code into a php file and setup a cron job to run the php file. This is the code: /* backup the db OR just a table */ function backup_tables($host,$user,$pass,$name,$tables = '*') { $link = mysql_connect($host,$user,$pass); mysql_select_db($name,$link); //get all of the tables if($tables == '*') { $tables = array(); $result = mysql_query('SHOW

options for restoring appengine datastore data?

落花浮王杯 提交于 2019-11-27 17:00:52
问题 A user of our application has accidently deleted data. They'd like this to be restored. We have no special logic or datastore entities that can do this. However, we do daily backups of our entire datastore to blobstore using the datastore admin. What are our options for selectively restoring part of this backup back into the datastore? We'd preferably like to not have a service interruption for other users. One final restriction is that we can not change our production app id (i.e. copy data

Restoring SQLite DB file

雨燕双飞 提交于 2019-11-27 15:23:01
问题 I'm implementing a backup/restore system in my android app. An automatic backup occures every couple of minutes. I'm trying to restore my db backup file from my sd card, after my app was uninstalled and then installed again. Backup works, but here's the problem: Whenever the user installs my app again, there's a file not found exception, but, if the user closes the app, and then opens it again, the restore is just fine. Somehow, the restoring faces problem when the app is first launched. The

Backup Permissions

微笑、不失礼 提交于 2019-11-27 14:28:20
问题 I created a new user on the server that will access certain databases. But when I go to backup or restore the database I get the error: C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Backup Cannot access the specified path or file on the server. Verify that you have the necessary security privileges and that the path or file exists..................... The error shows for any other path in my system. Even those where the user and the Service Account has full control

How to solve privileges issues when restore PostgreSQL Database

时光总嘲笑我的痴心妄想 提交于 2019-11-27 09:43:26
问题 I have dumped a clean, no owner backup for Postgres Database with the command pg_dump sample_database -O -c -U Later, when I restore the database with psql -d sample_database -U app_name However, I encountered several errors which prevents me from restoring the data: ERROR: must be owner of extension plpgsql ERROR: must be owner of schema public ERROR: schema "public" already exists ERROR: must be owner of schema public CREATE EXTENSION ERROR: must be owner of extension plpgsql I digged into

Export DB with PostgreSQL's PgAdmin-III

Deadly 提交于 2019-11-27 02:53:07
问题 How to export a Postgresql db into SQL that can be executed into other pgAdmin ? Exporting as backup file, doesn't work when there's a difference in version Exporting as SQL file, does not execute when tried to run on a different pgAdmin I tried exporting a DB with pgAdmin III but when I tried to execute the SQL in other pgAdmin it throws error in the SQL, when I tried to "restore" a Backup file, it says there's a difference in version that it can't do the import/restore. So is there a "safe"

Minimum GRANTs needed by mysqldump for dumping a full schema? (TRIGGERs are missing!!)

白昼怎懂夜的黑 提交于 2019-11-27 00:05:15
问题 I have a MySQL user called dump with the following perms: GRANT USAGE ON *.* TO 'dump'@'%' IDENTIFIED BY ... GRANT SELECT, LOCK TABLES ON `mysql`.* TO 'dump'@'%' GRANT SELECT, LOCK TABLES ON `myschema`.* TO 'dump'@'%' I want to dump all data (included triggers and procedures) using the dump user. I call mysqldump in the following way: mysqldump -u dump -p --routines --triggers --quote-names --opt \ --add-drop-database --databases myschema > myschema.sql Everything is OK with the dumped file