mysqldump

事务视图存储过程触发器数据备份

╄→尐↘猪︶ㄣ 提交于 2019-12-03 04:57:27
目录 事务 事务的特性 原子性(Atomicity): 一致性(Consistency): 隔离性(Isolation): 持久性(Durability): 存储引擎 InnoDB :保时捷引擎 MyIsam:奔奔引擎 视图 使用 增加视图 删除视图 触发器 存储过程 创建 函数 数据库的备份 语法 示列 事务 通俗的说,事物指一组操作,要么都执行成功,要么都执行失败 使用事务: start transactino sql语句 commit/rowllback # 演示: mysql> select * from t1; +----+------+--------+ | id | name | salary | +----+------+--------+ | 1 | aa | 1000 | | 2 | bb | 2000 | | 3 | dd | 3000 | +----+------+--------+ mysql> start transaction; mysql> update t1 set salary=100 where name='aa'; mysql> select * from t1; +----+------+--------+ | id | name | salary | +----+------+--------+ | 1 | aa | 100 | | 2

Compare structures of two databases?

狂风中的少年 提交于 2019-12-03 04:53:22
问题 I wanted to ask whether it is possible to compare the complete database structure of two huge databases. We have two databases, the one is a development database, the other a production database. I've sometimes forgotten to make changes in to the production database, before we released some parts of our code, which results that the production database doesn't have the same structure, so if we release something we got some errors. Is there a way to compare the two, or synchronize? 回答1: What

Can I merge two databases into one in Mysql if they both have the same schema?

守給你的承諾、 提交于 2019-12-03 04:13:43
I have two databases in MySQL that already have data. they have exactly the same schema. I would like to merge those two databases into one only. I tried: mysqldump -u root -p --databases database1 database2 database3 > database1_database2_da However, when I try to open database1_database2_da , I only end up with data from one of the database, but not all of them. I also want to mention that the two databases have their records starting at 1, since they are automatically generated. Do you think there is a way to merge those two databases without losing data from any of them? Run mysqldump on

Using mysqldump to format one insert per line?

大城市里の小女人 提交于 2019-12-03 04:04:37
问题 This has been asked a few times but I cannot find a resolution to my problem. Basically when using mysqldump, which is the built in tool for the MySQL Workbench administration tool, when I dump a database using extended inserts, I get massive long lines of data. I understand why it does this, as it speeds inserts by inserting the data as one command (especially on InnoDB), but the formatting makes it REALLY difficult to actually look at the data in a dump file, or compare two files with a

While importing mysqldump file ERROR 1064 (42000) near ' ■/ ' at line 1

丶灬走出姿态 提交于 2019-12-03 03:52:54
问题 Cannot import the below dump file created by mysqldump.exe in command line of windows /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `attachment_types` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `DESCRIPTION` varchar(50) DEFAULT NULL, `COMMENTS` varchar(256) DEFAULT NULL, PRIMARY KEY (`ID`), UNIQUE KEY `UK_ATTACHMENT_TYPES___DESCRIPTION` (`DESCRIPTION`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; While importing

MySQL操作(二)数据库

99封情书 提交于 2019-12-03 03:46:12
1、启动MySQL数据库(centos7为例 ) systemctl restart mariadb.service 或 systemctl restart mysqld.service systemctl status mysqld.service //查看mysql状态 2、查看数据库 SHOW DATABASES; 3、选择数据库 USE ss16; 4、创建数据库 CREATE DATABASE IF NOT EXISTS ss16; 5、删除数据库 DROP DATABASE IF EXISTS ss16; 6、数据库备份 mysqldump -uroot -p ss16>C:/ss16.sql; mysqldump -h 192.168.0.24 -u root -p eb2>/tmp/eb2.sql; -- 防止锁表 针对Innodb引擎 mysqldump -h 192.168.0.24 -u root -p --single-transaction eb2>/tmp/eb2.sql; -- 备份库中的指定表(多个表空格隔开) mysqldump -h10.1.62.40 -u root -p train online_back online_course> c:\online_data.sql; -- 备份库中的指定表中的部分数据 mysqldump -h10.1

Skip or ignore definers in Mysqldump

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I was wondering if I can prevent mysqldump inserting this commands /*!50017 DEFINER=`root`@`localhost`*/ Or if I have to do it afterwards with sed, for example Thanks! 回答1: This issue has been around since 2006 with no sign of ever being fixed. I have, however, piped it through grep (linux only) to trim out the definer lines before writing the dump file: mysqldump -u dbuser -p dbname | grep -v 'SQL SECURITY DEFINER' > dump.sql A bit of a mouthful (or keyboardful?) but I think it's the only way. 文章来源: Skip or ignore definers in Mysqldump

Mysqldump command not found

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to export my database and i am using this code: mysqldump -p -u markazo_b markazo_b > /tmp/file.sql But SSH show this error: -bash: mysqldump: command not found How i fix this problem? 回答1: After reading your conversation, I found the solution (for me, at least). It was a permissions issue. Issuing which mysqldump in the terminal shows /usr/bin/mysqldump . When I then issue cd /usr/bin/ and afterward mysqldump I receive the same indications you were seeing: mysqldump: command not found . Inside /usr/bin I then issued sudo mysqldump

Problem with mysqldump: “--defaults-extra-file” option is not working as expected

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I run the following command from the Windows command line to backup my database: ...\right_path\mysqldump --add-drop-database --databases my_database_name --defaults-extra-file=d:\1.cnf where d:\1.cnf contains the following: [client] user="my_user" password="my_password" Unfortunately, I got the following error message: mysqldump: unknown variable 'defaults-extra-file=d:\1.cnf' If I do: ...\right_path\mysqldump --add-drop-database --databases my_database_name --user="my_user" --password="my_password" it works as expected. What am I doing

mysqldump access denied

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When I try to backup using mysqldump from ssh, I run the following command on machine 10.64.1.1. It gives the following error. mysqldump --user=test -p=password --host=10.64.1.2 --tab=. databasename tablename mysqldump: Got error: 1045: Access denied for user 'test'@'10.64.1.1' (using password: YES) when trying to connect However, I can access mysql using the same user and password. mysql --user=test -p[password] Current user: test@10.64.1.1 SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server version: 5.0.91-50