mysql 5.5 mysqldump 原文翻译_MySQL
mysqldump
bitsCN.com 根据mysql 5.5第6.4章节理解和自己翻译水平有限如有纰漏请指教,原文如下.http://dev.mysql.com/doc/refman/5.5/en/using-mysqldump.html 6.4 使用mysqldump备份(Using mysqldump for Backups)首先多余的不用说了备份用来干什么大家都清楚。mysqldump备份分两种输出形式:1. 无--tab选项,输出标准的SQL格式。输出包含CREATE语句(databases,tables,stored routines,and so forth),INSERT语句插入数据到表。输出可以保存成一个文件,之后可以用mysql再次创建。选项可以控制输出SQL语句格式,文件类型。2. 含--tab选项,每个表对应两个备份文件。一个文件为由tab分割的文本,一行对应一条数据记录,在目录中这个文件输出名为tb1_name.txt。同样会创建一个含有CREATE TABLE语句,名为tb1_name.sql的文件。 6.4.1 使用mysqldump备份SQL数据(Dumping Data in SQL Format with mysqldump)默认语法shell>mysqldump [arguments] > file_name
shell>mysqldump --all-databases > dump.sql
shell>mysqldump -uroot -p --all-databases > dump.sql
shell>mysqldump --databases db1 db2 db3 > dump.sql
shell>mysqldump --databases test > dump.sql
shell>mysqldump test > dump.sql
省略--databases时备份文件没有CREATE DATABASE,USE。有下面几方面含义。1.当你导入备份文件时,你必须选择一个默认数据库名这样程序才知道要导入到哪个数据库。2.当导入到时候你可以选择一个不同的数据库名。3.如果要导入到数据库不存在,你必须提前创建。4.因为输出文件没有CREATE DATABASE,所以--add-drop-database选项没有效果,如果你使用也没有DROP DATABASE。 选择表备份,表名跟在数据库名之后
shell>mysqldump test t1 t3 t7 > dump.sql
shell>mysql 另外在mysql内部你可以这样写<pre class="brush:php;toolbar:false">mysql>source dump.sql;
shell>mysqladmin create db1
shell>mysql db1 另外在mysql内部创建数据库,选择数据库,导入备份:<pre class="brush:php;toolbar:false">mysql>CREATE DATABASE IF NOT EXISTS db1;<br>mysql>USE db1;<br>mysql>source dump.sql
shell>mysqldump --tab=/tmp db1
shell> mysqldump --tab=/tmp --fields-terminated-by=, --fields-enclosed-by='"' --lines-terminated-by=0x0d0adb1
1 shell> mysql db1 2 shell> mysqlimport db1 t1.txt
1 mysql> USE db1;<br>2 mysql> LOAD DATA INFILE 't1.txt' INTO TABLE t1;
1 shell>mysqlimport --fields-terminated-by=, --fields-enclosed-by='"' --lines-terminated-by=0x0d0a db1 t1.txt
1 mysql>USE db1;<br>2 mysql>LOAD DATA INFILE 't1.txt' INTO TABLE t1<br>3 ->FIELDS TERMINATED BY ',' FIELDS ENCLOSED BY '"'<br>4 ->LINES TERMINATED BY '/r/n';
1 shell> mysqldump db1 > dump.sql<br>2 shell> mysqladmin create db2<br>3 shell> mysql db2 在使用db1备份文件覆盖db2时不要使用--databases选项因为那样会在备份文件中写入USE db1. <strong>6.4.5.2 从一个服务器复制数据库到另一个服务器(Copy a Database from one Server to Another)</strong>服务器1:<pre class="brush:php;toolbar:false">1 shell>mysqldump --databases db1 > dump.sql
1 shell>mysql 使用mysqldump时添加--database选项备份文件会包含CREATE DATABASE和USE语句,如果不存在则会创建同时设为默认数据库在导入数据。 你可以忽略--database选项,但在导入数据库的时候需要创建一个数据库(如果需要)然后设置为当前数据库。 服务器1:<pre class="brush:php;toolbar:false">1 shell>mysqldump db1 > dump.sql
1 shell> mysqladmin create db1<br>2 shell> mysql db1 所以忽略--database选项就可以选择不同的数据库导入。 <strong>6.4.5.3 备份存储程序(Dumping Stored Programs)</strong>以下是存储程序几个可选选项(存储过程函数,触发器,日志)--events:调度事件--routines:存储过程和函数--triggers:触发器 triggers默认是备份的routines,events需要选择性备份默认是不备份的可以选择跳过--skip-events, --skip-routines, --skip-triggers。 <strong>6.4.5.4 备份表定义和内容分开(Dumping Table Definitions and Content Separately)</strong>--no-data选项告诉mysqldump不备份表数据,备份文件仅包括创建表。相对的--no-create-info选项告诉mysqldump备份仅包含数据。示例:<pre class="brush:php;toolbar:false">1 shell> mysqldump --no-data test > dump-defs.sql<br>2 shell> mysqldump --no-create-info test > dump-data.sql
shell> mysqldump --no-data --routines --event stest > dump-defs.sql
shell> mysqldump --all-databases --no-data --routines --events > dump-defs.sql
shell> mysql 因为备份文件没有表数据库,所以可以处理的很快。这可以发现潜在的不兼容,而不需要长时间的数据加载操作。查看备份文件处理时发生的警告或错误。在验证了没有兼容性问题后备份表数据导入到新服务器在现有服务器:<pre class="brush:php;toolbar:false">shell> mysqldump --all-databases --no-create-info > dump-data.sql
shell> mysql 现在检查表内容运行一些测试查询bitsCN.com

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The edge browser comes with a translation function that allows users to translate anytime and anywhere, which brings great convenience to users. However, many users say that the built-in translation webpage is missing. Then the edge browser automatically What should I do if the translation page I brought is missing? Let this site introduce how to restore the translated web page that comes with the Edge browser if it is missing. How to restore the translation webpage that comes with the Edge browser is missing 1. Check whether the translation function is enabled: In the Edge browser, click the three dots icon in the upper right corner, and then select the "Settings" option. On the left side of the settings page, select the Language option. Make sure "Translate&rd"

According to news on July 22, today, the official Weibo of Xiaomi ThePaper OS announced that Xiaoai Translation has been upgraded. Real-time subtitles have been added to Japanese and Korean translations, and subtitle-free videos and live conferences can be transcribed and translated in real time. Face-to-face simultaneous interpretation supports translation into 12 languages, including Chinese, English, Japanese, Korean, Russian, Portuguese, Spanish, Italian, French, German, Indonesian, and Hindi. The above functions currently only support the following three new phones: Xiaomi MIX Fold 4 Xiaomi MIX Flip Redmi K70 Extreme Edition It is reported that in 2021, Xiao Ai’s AI subtitles will be added to Japanese and Korean translations. AI subtitles use Xiaomi’s self-developed simultaneous interpretation technology to provide a faster, more stable and accurate subtitle reading experience. 1. According to the official statement, Xiaoai Translator can not only be used in audio and video venues

How does Sogou browser translate? When we usually use Sogou browser to check information, we will encounter some websites that are all in English. Because we can’t understand English, it is very difficult to browse the website. This is also very inconvenient. It doesn’t matter if you encounter this situation! Sogou Browser has a built-in translation button. With just one click, Sogou Browser will automatically translate the entire webpage for you? If you don’t know how to operate it, the editor has compiled the specific steps on how to translate it on Sogou Browser. If you don’t know how, follow me and read on! How to translate Sogou Browser 1. Open Sogou Browser, click the translation icon in the upper right corner 2. Select the type of translation text, and then enter the text that needs to be translated 3. Sogou Browser will automatically translate the text. At this point, the above Sogou Browsing operation is completed. How to translate all contents

Browsers generally have built-in translation functions, so you don’t have to worry about not being able to understand when browsing foreign language websites! Google Chrome is no exception, but some users find that when they open the translation function of Google Chrome, there is no response or failure. What should they do? You can try the latest solution I found. Operation tutorial: Click the three dots in the upper right corner and click Settings. Click Add Language, add English and Chinese, and make the following settings for them. The English setting asks whether to translate web pages in this language. The Chinese setting displays web pages in this language, and Chinese must be moved to the top before it can be set as the default language. If you open the webpage and no translation option pops up, right-click and select Translate Chinese, OK.

Building a real-time translation tool based on JavaScript Introduction With the growing demand for globalization and the frequent occurrence of cross-border exchanges and exchanges, real-time translation tools have become a very important application. We can leverage JavaScript and some existing APIs to build a simple but useful real-time translation tool. This article will introduce how to implement this function based on JavaScript, with code examples. Implementation Steps Step 1: Create HTML Structure First, we need to create a simple HTML

Why can't Google Chrome translate Chinese? As we all know, Google Chrome is one of the browsers with built-in translation. When you browse pages written in other countries in this browser, the browser will automatically translate the page into Chinese. Recently, some users have said that they Chinese translation cannot be performed. At this time, we need to fix it in the settings. Next, the editor will bring you the solution to the problem that Google Chrome cannot translate into Chinese. Friends who are interested should come and take a look. Google Chrome cannot translate Chinese solutions 1. Modify the local hosts file. Hosts is a system file without an extension. It can be opened with tools such as Notepad. Its main function is to define the mapping relationship between IP addresses and host names. It is a mapping IP address

What should I do if Sogou Browser cannot translate this webpage? Sogou Browser is a very easy-to-use multi-functional browser. Its web page translation function is very powerful and can help us solve most of the troubles in study and work. However, some friends reported that Sogou Browser has a problem that it cannot translate this web page. This may be caused by improper operation. It can be solved by operating the translation function correctly. Below, the editor will bring you the problem that Sogou Browser cannot translate. Translate this page solution. Sogou Browser cannot translate this webpage Solution Method 1: 1. Download and install Sogou Browser 2. Open Sogou Browser 3. Open any English website 4. After the website is opened, click the translation icon in the upper right corner 5. Select Translate text type and click Translate current web page 6

In iOS 17.2, overcome communication barriers with new custom translation options for iPhone action buttons. Read on to learn how to use it. If you have an iPhone with an action button, like the iPhone 15 Pro, Apple's iOS 17.2 software update brings new translation options to the button, allowing you to translate live conversations into multiple languages. According to Apple, the translations are not only accurate, but also context-aware, ensuring nuances and spoken language are captured effectively. This feature should be a boon for travelers, students, and anyone learning a language. Before using the translation feature, be sure to select the language you want to translate into. You can do this through Apple's built-in Translate app
