Feed on
Subscription

Root password was lost how to be made up for in MySQL

Losing a password is very distressed thing,Especially Root password was lost: (.Him outfit outfit plays lost also lost,But in case it is the server hanged a trouble but big!Now is as a result of the Root that is inbreaked to cause the password is lost suppose.I talk about myself to be opposite here the view of a such problems.Encounter this kind of problem above all we were not necessary flurried,Whole resuming a course also is very simple.

Source of MySQL of 1 download issues a package,Need not distinguish operating system,The thing that we need is same.

The Mysql folder below the Data catalog of the Mysql that 2 names him again is Oldmysql.

The Mysql list that 3 issues list of the Data in source bag duplicates below the Data catalog of your Mysql.

4 starts Mysql afresh,The accredit relation of Mysql is the same as now brand-new of installation same,Empty password is landed,Adjust accredit by oneself next.

5 opens Oldmysql this library examination appeared after all what problem.

If 6 has backup to undertake to database of some of systematic Central Plains integrality detects,Lest be revised.

Can have restored you completely through 6 afore-mentioned measure to the control of Mysql,The key is finally two paces check the other side to changing those attributive,And the integrality of data detects.

...

The biggest join in how increasing MYSQL is counted?

The acquiesce of number of the biggest join of Mysql is 100, the database application with this very much to intercurrent join numerical value is far insufficient,After should joining the request is more than acquiescent join to count,Can appear cannot join the mistake of the database,Accordingly we need to move it appropriately a few bigger,

Two kinds of method can revise the biggest join to count,One kind is modification Safe_mysqld,Another kind is to revise former code to be compiled afresh directly.We introduce these two kinds of methods respectively below:



1. revises Safe_mysqld


Find Safe_mysqld to edit it,Two that when find Mysqld to start,Parameter is added at the back:


- O Max_connections=1000


For example:(Among them in front have---The content that is before,And + + + it is to had been revised the following)


---Safe_mysqld.orig Mon Sep 25 09:34:01 2000


+ + + Safe_mysqld Sun Sep 24 16:56:46 2000


@@ -109, 10 +109, 10 @

If Test "$#" -eq 0

Then

Nohup $ledir/mysqld- - Basedir=$MY_BASEDIR_VERSION- - Datadir=$DATADIR


-- - Skip-locking %26gt;%26gt;$err_log 2%26gt;%26amp;1


+- - Skip-locking -O Max_connections=1000 %26gt;%26gt;$err_log 2%26gt;%26amp;1

Else

Nohup $ledir/mysqld- - Basedir=$MY_BASEDIR_VERSION- - Datadir=$DATADIR


-- - Skip-locking %26quot;$@%26quot; %26gt;%26gt;$err_log 2%26gt;%26amp;1


+- - Skip-locking %26quot;$@%26quot; -O Max_connections=1000 %26gt;%26gt;$err_log 2%26gt;%26amp;1

Fi

If Test! - F $pid_file # This Is Removed If Normal Shutdown

Then



Shut Mysql to restart next it,With


/ Mysqladmin is in method / Mysqladmin -uroot -p Variables



Input Root database can see after the password of Zhang date


| Max_connections | 1000 |


Namely new alter already become effective.



2. amends former code


The former code of unlock MySQL,Enter the Sql catalog inside to revise Mysqld.cc to find below group:


{"max_connections" , (Long*) %26amp;max_connections, 100, 1, 16384, 0, 1} ,


its instead:


{"max_connections" , (Long*) %26amp;max_connections, 1000, 1, 16384, 0, 1} ,


Save file to disk exit,Next. / Configure;make;make Install can achieve similar result.

...

Derive from inside SQL a of MYSQL simple method

Derive from Sql the method of Mysql is very much,Introduce a kind now need not process designing,The simple method that uses the graphical interface in Sql and Mysql to undertake guiding deriving directly.

Premise is the Phpmyadmin of tool of graphical interface government that had installed Sqlserver client end and Mysql.

Sqlserver business management is opened below console root catalog implement,Build Sqlserver group,Undertake choosing according to oneself circumstance;Build Sqlserver to register next,The link that has pair of Sqlserver.After preparation is proper,Began below:

Open data to change a service above all,Build a packet,Open DTS interface,In join choice data source undertakes configuration.The purpose file that reelection choose will change,The Textfile(destination) that I choose here,Choose good file after depositing the position,We will build a task.We choose to change data job only here,Will contain " choice source joins " " choice purpose joins " the mouse parts after source of pitch on data and purpose,The link that we become to the new student has a definition,In source of its attribute lieutenant general,Purpose,Change ordinal definition.

Executive task,Clew is successful.Save the job.Derive on newly-built task next data,Guide hints,Among them a choice " from source data library duplicate watch is mixed view " .

This one pace has derived data in purpose file.

Build a list in Mysql next,When keeping consistent with the structure that will guide,Choose directly " from data of the extraction in text file,Insert data to express:" ,After buying option," send " OK,Browse,Data already guided.If want the list that guides,had existed,And attribute name is different also,The list that builds an as identical as the data that should guide structure first at this moment guides data (by a moment ago it is OK to undertake) ,Derive in Mysql next " data and structure " ,Receive Sql sentence,In the editor in text file its,Use text editor replace a function,the watch the name is revised,Row name is joined,Finally its stickup wanting to guide the place of the executive Sql statement of the watch,Carry out,Data guided.

The mistake appears in be like a process,The option that asks microscope configuration,Ensure correct.

...

From compile a tool:Of a few kinds of Mysql optimize a method

One, Mysql ? is optimized when compile
If you distribute installation Mysql from source code,Should notice,The effect with compile a process to have to function of the following object program main,Compile means differently to may obtain similar target document,But function may differ very big,Because of this,Compiling installation Mysql to suit to choose carefully to compile option well the most possibly according to your applied type.This kind of custom-built Mysql can offer optimum behavior for your application.?
Skill:It is better to choose compile implement it is better to mix compile implement option,Such application can raise function 10-30% .(Mysql documentation says so) ?

1.1, use Pgcc (Pentium ? Gcc) is compiled implement ?
Should compile implement (Http://www.goof.com/pcg/ ) in the light of move in gallop the program on processor system undertakes optimizing,Compile Mysql source code with Pgcc,Overall performance can rise 10% .If your server is not to use,gallop of course processor,Need not use it,Because it is to be only,gallop the system designs.?

1.2, the character set that uses you to want to use only compiles Mysql ?The character set that Mysql looks premise differs for amounting to 24 kinds,The data in be inserted with the language of themselves for global user or examining a watch.Save a circumstance to fall however,Mysql installation is possessory these character set,Hot however,Best choice is to point to those who choose a kind of your need.Like,Prohibit removing all other character set beyond Latin1 character set:?
------------------------------------------------------------------------------?
%%26gt; . / Configure ? - With-extra-charsets=none ? [- - Other-configuration-options] ?
------------------------------------------------------------------------------?

1.3, compile Mysqld the static state to carry out file ?
Compile Mysqld the performance with the static state carries out a file and need not share a library to also can be obtained better.Through following options is being appointed when configuration,But the static state compiles Mysqld.?
------------------------------------------------------------------------------?
%%26gt; . / Configure ? - With-mysqld-ldflags=-all-static ? [- - Other-configuration-options] ?
------------------------------------------------------------------------------?

1.4, configuration example ?
Following configuration command is commonly used at improving performance:?
------------------------------------------------------------------------------?
%%26gt;cflags=%26quot;-o6 ? - Mpentiumpro ? - ? of Cxxflags=%26quot;-o6 of ? of Fomit-frame-pointer%26quot; ? Cxx=gcc - Mpentiumpro ? - Fomit-frame-pointer ? - Felide-constructors ? - Fno-exceptions ? - Fno-rtti%26quot; ? . / Configure ?- - Prefix=/usr/local ?- - Enable-assembler ?- - With-mysqld-ldflags=-all-static ?- - Disable-shared ?
------------------------------------------------------------------------------?

Two, adjust server ?
Ensure apply it is admittedly important to be compiled correctly,But the first pace that this just succeeds,The Mysql variable with numerous configuration is likewise right of the server run a crucial function normally.You can assign these variably existence configures a file in,With ensuring they all act well when starting Mysql every time,This configuration file is My.cnf file.?The example that Mysql had provided document of a few My.cnf,Can be in / find below Usr/local/mysqld/share/mysql/ catalog.These files name respectively for My-medium.cnf of My-small.cnf, ? , My-large.cnf and My-huge.cnf,Dimensions specification can configure a file in the description find in applicable systematic type caption.If be on the system that has quite little memory only,run Mysql,And just now and then with,So My-small.cnf will be idealer,Because it commands Mysqld uses least resource only.Similar,If you plan compose to establish supermarket of electronic business affairs,And the system has 2g memory,So you should use Mysql-huge.cnf document possibly.?
To use one of these files,You need to duplicate a file that fits requirement most,Incognito for My.cnf.You can choose a kind of limits of three kinds of action to use configuration document:?Global:Duplicate My.cnf file of the server / below Etc catalog,The variable action that this makes configuration file medium at overall situation,The Mysql database server that goes up to all servers namely is effective.
? Local:Duplicate My.cnf file [below Mysql-install-dir]/var/ catalog,Make My.cnf action at specific server.[Mysql-install-dir] states Mysql installs catalog.
? User:You can restrict action again at specific user,Duplicate My.cnf to fall to the root catalog of the user.?
These variable in how installing My.cnf after all?Say further,You can install which variable.Although what use variable relatively general to Mysql server,Of each variable and Mysql certain component has more specific concern.If variable Max_connects returns,fall in Mysqld category.Carry out following command to be able to know:?
------------------------------------------------------------------------------?
%%26gt;/usr/local/mysql/libexec/mysqld ?- - Help ?
------------------------------------------------------------------------------?
It shows many options and the variable related to Mysqld.You can be easily under word of this style or manner of writing find out variable:?
------------------------------------------------------------------------------?Option ? of ? of For of ? of Possible ? Variables- - Set-variable ? (- ? of O) ? Are
------------------------------------------------------------------------------?
Next you can install those variable in My.cnf as follows:?
------------------------------------------------------------------------------?? of Max_connections=100 of ? of Set-variable ? =
------------------------------------------------------------------------------?
The number of the biggest intercurrent join that it sets Mysql server is 100.Should ensure in My.cnf file [variable setting is inserted below Mysqld] caption.?

Three, watch type ?
Likelihood of user of a lot of Mysql is very open-eyed,Mysql offers 5 kinds of different watch types for the user really,Call Dbd, Heap, Isam, Merge and Myiasm.Dbd returns for clerical safety kind,And other to be not clerical safety kind.?

3.1, clerical safety ?Dbd ?The watch that watch of Berkeley ? Db(dbd) is processing of supportive general affairs,By Sleepycat software company (Http://www.sleepycat.com) is developed.It offers Mysql user to expect long already function - general affairs is controlled.Clerical control is an extremely valuable function in any database systems,Because they ensure,a group of commands are carried out successfully.?

3.2, ? of safety of blame general affairsHeap ?Heap watch is the list with the sharpest data is accessed in Mysql.Because they use memory to breath out rare index in one of dynamic memory,this is.If Mysql or server break down,another point is,Data will be missing.?
Isam ?The default that Isam watch is inchoate Mysql version expresses a kind,Till Myiasm development comes out.The proposal does not want reuse it.?
Merge ?Merge is an interesting new type,In 3.23.25 later appear.Watch of a Merge is the gather that an identical Myisam expresses actually,Amalgamative into a watch,Basically be for efficiency reason.Can raise efficiency of speed, search, repair efficiency to save disk space so.?
Myiasm ?
The default that this is Mysql expresses a kind.It is based on Iasm code,But a lot of expand usefully.The reason with better Myiasm:?Myiasm watch is less than Iasm to express,Use less resource so.?Myiasm watch is on different platform binary layer can transplant.?
Bigger key piles up dimension,Bigger key piles up upper limit.?

3.3, appoint watch type ?
The type that the watch specifies when you are founding a watch.Next exemples found a Heap to express:?
------------------------------------------------------------------------------?? of Type=heap of ? of Email_addresses of ? of Mysql%26gt;create ? Table (?
- %26gt; Null of ? of Not of Email ? Char(55) ? , ?
- %26gt; Null of ? of Not of Name ? Char(30) ? , ?
- %26gt; ? of Primary ? Key(email) ) ; ?
------------------------------------------------------------------------------?Bdb watch needs a few configuration to work,Refer to Http://www.mysql.com/doc/b/d/bdb_overview.html.?

3.4, more watch type ?
To make Mysql management job more interesting,The Mysql ? that is about to release 4 will offer two kinds of new watch types,Call Innobase and Gemeni.?

Four, optimize tool ?Mysql server itself offerred a few inside buy order is used at the help to optimize.?

4.1, Show ?
You may have fun at know Mysql server after all more what,Following command gives out a summary:?
------------------------------------------------------------------------------?? of Mysql%26gt;show ? Status;
------------------------------------------------------------------------------?
It gave out a quite long condition variable and the list that its are worth.The the time that the amount that some variable contained abort client, abort connective amount, join tries, biggest intercurrent join is counted and a large number of other and useful information.These information have value extremely to finding out systematic issue and small effect.?Show still can do more businesses.It can show the valuable information in be being expressed about log file, specific database, watch, index, process and attributive.Detailed sees Mysql manual.?

4.2, Explain ?
When you face Select sentence,How is command of Explain explanation Select handled.This indexes to deciding to whether should increase not only,And it is helpful to deciding how a complex Join is handled by Mysql.?

4.3, Optimize ?Optimize statement allows you to restore space and fragment of amalgamative data file,Lengthen to including after the watch of travel undertook be updated in great quantities and be deletinged,It is particularly important to such doing.Optimize works to be expressed at Myiasm and Bdb only at present.

...

The version after Mysql3.23.15 installs data synchronism

Mysql offers a database later from 3.23.15 version duplicate function.Use this function to be able to realize two databases synchronism,Mode of principal and subordinate,The function of mutual backup mode.

The setting of duplicate function is in database synchronism the setting of Mysql is reflected in the file.The configuration file of Mysql (it is My.cnf commonly) ,Be in below Unix environment / the My.cnf that Etc/mysql/my.cnf perhaps issues in the Home catalog of Mysql user.
In Window environment,If C: ??cangue stalking or branch sweeps past ? Y.cnf file to take this to configure a file.When the Winmysqladmin.exe tool moment of moving Mysql,This tool is met a C: ?.cnf of ? of busy of ? cangue stalking or branch names for Mycnf.bak.Found My.ini below Winnt catalog.The Mysql server moment that start can read this to configure a file.In can copying the content in My.cnf to My.ini file so,The configuration file that regards Mysql as the server with My.ini file.

Set a means:

Setting example environment:

Operating system:Window2000 Professional
Mysql:4.0.4-beta-max-nt-log
A Ip:10.10.10.22
B Ip:10.10.10.53
A: ?haddock ?BR>
1. adds the user account with a most synchronous user:
Grant File On * . * To Backup@''10.10.10.53'' Identified By ' 1234 '

2. increases a database to serve as synchronous database:
Create Database Backup
B: ?haddock ?BR>
1. adds the user account with a most synchronous user:
Grant File On * . * To Backup@''10.10.10.22'' Identified By ' 1234 '

2. increases a database to serve as synchronous database:
Create Database Backup

Mode of principal and subordinate:A-%26gt;b
A is Master

The My.ini file of modification A Mysql.Configure in Mysqld in join below configuration:
Server-id=1log-bin# setting needs to record Log to be able to install Log-bin=c:mThe catalog of file of log of Ysqlbakmysqllog setting,# among them the name that Mysqllog is log file,Mysql will build different and patulous name,The file of a few logs that file name is Mysqllog.Binlog-do-db=backup # appoints the database that needs a log

Remove a database to serve again.

With Show Master Status the command treats log condition.
B is Slave

The My.ini file of modification B Mysql.Configure in Mysqld in join below configuration:
User account Master-password=1234master-port=3306master-connect-retry=60 sets Server-id=2master-host=10.10.10.22master-user=backup # synchronism to try what 60 seconds Replicate-do-db=backup tells interval Slave does Backup database only to update again beforehand

Remove a database again

See synchronism configure a circumstance with Show Slave Status.

Notice:As a result of the configuration information that installed Slave,Mysql generates Master.info below database catalog,If have the configuration that should revise relevant Slave,should delete this file first so.The configuration that revises otherwise cannot become effective.

Mode of equipment of double machine each other.

If Slave is joined to install in A,Master is joined to install in B,The synchronism that can do B-%26gt;a.

Configure in the in configuring a file Mysqld of A join the following setting:
Master-host=10.10.10.53master-user=backupmaster-password=1234replicate-do-db=backupmaster-connect-retry=10

Configure in the in configuring a file Mysqld of B join the following setting:
Log-bin=c:mYsqllogmysqllogbinlog-do-db=backup

Notice:File of log of the *.err when should having wrong generation.Synchronous line Cheng is exited,Should let synchronous mechanism have the job after correcting an error,Moving Slave Start

Heavy machine removing Ab,Can realize two-way hot equipment.

Test:

Insert great data bulk to express Aa to B batch (1872000) ,A database per sec. can update 2500 data.

...

Class of introduction of the Mysql below Windows uses a method basically

One, Mysql brief introduction
The database server software that Mysql is Long of a cabinet spirit,To the medium, small-sized applying that the system is special ideal.Besides the statement of Ansi ? Sql that supports a level,The most important is,It still supports a variety of platform,And on Unix/linux system,Mysql supports multi-line Cheng run mode,Can acquire quite good property thereby.It and before two software are same,It is to belong to open source code soft.

Two, the installation of Mysql (point to Windows version)

the file after download solution is controlled,To a catalog,Moving Setup program,Meeting clew is whole the process of installation.Its acquiesce installs C:\Below Mysql,If want to install other catalog to fall to still have,alter something,As abecedarian,Can first without giving thought to,Install with acquiescent catalog.good,After installation,Enter C:\Below Mysql\bin catalog,Moving Mysqld-shareware.exe file

Move directly below Win98,Below normal circumstance,Without what clew information

Can input below Nt:Mysqld-shareware ?- - Install ? starts this service

Then,Input Mysql ? ,Information of a few clew can appear to give now clew mark below normal circumstance:
Mysql%26gt;

Come here,You installed Mysql already successfully.

Three, code of setting Mysql user
The acquiescent user name of Mysql database is " Root " (the ? Sa ? of Server ? of ? of Ms ? Sql is similar) ,Password silent thinks empty.In Dos clew accord with (notice,Not be Mysql clew accord with) next inputs
C:\Mysql\bin%26gt; %26quot; Mysqladmin ? - ? of U ? Root - Adminpassword of P ? Password ?

The meeting after carriage return hints you input original password,It is as a result of original password empty,Immediate carriage return,The password of Root user instead " Adminpassword " .

Four, use Mysql database simply

The database of 1. indication Mysql (notice:In this article with hind cent,If do not have clew,The command of the input is to be below Mysql clew accord with)
Show ? Databases

2. opens a database
Use ? Test

Among them,Test is database name

3. shows all data in a database express ? (must open a database first) ? ? ?
Show ? Tables
Go

4. founds a database with Root identity (in Dos clew symbol falls)
Mysqladmin ? - ? of U ? Root - ? Gsbook of Create of ? of Adminpassword of P ? Password ?

Can hint you input a password then.Because of,Our purpose is to do to leave a message board,I name the name of the database here for " Gsbook " .

5. joins data list in the database
Auto_increment of ? of Null of ? of Not of ? of Int of ? of Gsbook(id of ? of Create ? Table, primary ? Key(id) , nickname ? Varchar(30) , email ? Varchar(30) , homepage ? Varchar(30) , note ? Text, w_time ? Datetime)

...

How need not process designing derives data SQL MYSQL

Derive from Sql the method of Mysql is very much,Introduce a kind now need not process designing,The simple method that uses the graphical interface in Sql and Mysql to undertake guiding deriving directly.

Premise is the Phpmyadmin of tool of graphical interface government that had installed Sqlserver client end and Mysql.

Sqlserver business management is opened below console root catalog implement,Build Sqlserver group,Undertake choosing according to oneself circumstance;Build Sqlserver to register next,The link that has pair of Sqlserver.After preparation is proper,Began below:

Open data to change a service above all,Build a packet,Open DTS interface,In join choice data source undertakes configuration.The purpose file that reelection choose will change,The Textfile(destination) that I choose here,Choose good file after depositing the position,We will build a task.We choose to change data job only here,Will contain " choice source joins " " choice purpose joins " the mouse parts after source of pitch on data and purpose,The link that we become to the new student has a definition,In source of its attribute lieutenant general,Purpose,Change ordinal definition.

Executive task,Clew is successful.Save the job.Derive on newly-built task next data,Guide hints,Among them a choice " from source data library duplicate watch is mixed view " .

This one pace has derived data in purpose file.

Build a list in Mysql next,When keeping consistent with the structure that will guide,Choose directly " from data of the extraction in text file,Insert data to express:" ,After buying option," send " OK,Browse,Data already guided.If want the list that guides,had existed,And attribute name is different also,The list that builds an as identical as the data that should guide structure first at this moment guides data (by a moment ago it is OK to undertake) ,Derive in Mysql next " data and structure " ,Receive Sql sentence,In the editor in text file its,Use text editor replace a function,the watch the name is revised,Row name is joined,Finally its stickup wanting to guide the place of the executive Sql statement of the watch,Carry out,Data guided.

The mistake appears in be like a process,The option that asks microscope configuration,Ensure correct.

...

MYSQL makes mistake code list

1005:Found watch failure
1006:Found database failure
1007:The database already existed,Found database failure
1008:The database is nonexistent,Cutout fails except the database
1009:Cannot delete database file to bring about cutout to fail except the database
1010:Cannot delete data catalog to bring about cutout to fail except the database
1011:Cutout fails except database file
1012:Cannot read the record in taking a system to express
1020:The record already was revised by other user
1021:The space is not worth hard disk the rest,Increase hard disk to be able to use a space please
1022:Key word repeats,Change record failure
1023:The mistake happens when shutting
1024:Read file mistake
1025:The mistake happens when changing a name
1026:Write file mistake
1032:The record is nonexistent
1036:Data table is read-only,Cannot undertake modification to it
1037:Systematic memory is insufficient,Restart please database or restart server
1038:At the memory inadequacy of sort with,Increase sort buffer please
1040:The biggest join that already arrived at a database is counted,Increase a database to be able to use join number please
1041:Systematic memory is insufficient
1042:Invalid leader name
1043:Invalid join
1044:Current user did not visit the attributive of the database
1045:Cannot join database,User name or password are wrong
1048:The field cannot is empty
1049:The database is nonexistent
1050:Data table already existed
1051:Data table is nonexistent
1054:The field is nonexistent
1065:Invalid SQL statement,SQL statement is empty
1081:Cannot establish Socket link
1114:Data list is full already,Cannot hold any records
1116:The data table that open is too much
1129:The database appears unusual,Restart please database
1130:Join database fails,Without the attributive of join database
1133:Database user is nonexistent
1141:Current user has no right to visit a database
1142:Current user has no right to visit data table
1143:Current user has no right to visit data to express medium field
1146:Data table is nonexistent
1147:Did not define the visit limits of authority that the user expresses to data
1149:SQL statement solecism
1158:Network mistake,Occurrence misread by accident,Inspect network join condition please
1159:Network mistake,Read overtime,Inspect network join condition please
1160:Network mistake,Occurrence clerical error by accident,Inspect network join condition please
1161:Network mistake,Write overtime,Inspect network join condition please
1062:Field value repeats,Put in storage fails
1169:Field value repeats,Newer record fails
1177:Open data to express failure
1180:Refer clerical failure
1181:Time roll clerical failure
1203:The biggest join that the link that current user and database establish already arrived at a database is counted,Increase practicable database to join is counted or restart please database
1205:Add lock overtime
1211:Current user did not establish the limits of authority of the user
1216:External key tie examines failure,Newer child souvenir records failure
1217:External key tie examines failure,Delete or revise advocate souvenir records failure
1226:The resource that the resource that current user uses already allowed more than,Restart please database or restart server
1227:Attributive is insufficient,You have no right to undertake this is operated
1235:MySQL version is too low,Do not have this function

...

Method of the simplest backup MySql database

Use MYSQL backs up into travel database,Have very standard database backup method,Have same idea with other database servers,But had thought,MySQL can have more the backup method of the use file directory of forthright,And had had quickly again.

One, data backup shortcut

The test and verify that did not obtain documentation of government-owned Founder type because of this method,Our of short duration calls an experiment.

Purpose:TestA of database of a Mysql in backup HostA lead plane,In restoring HostB plane

Experiment environment:

Operating system:WinNT4.0,Mysql3.22.34,PhpMyAdmin 2.1.0

Mysql database is installed in HostA and build TestA database
HostB machine installs Mysql database,Without TestA database

Methodological measure:

The PhpMyAdmin that start looks carefully at the database list in HostA and HostB,TestA database is done not have in HostB

The installation catalog of the Mysql in finding HostA,Find database catalog Data

In my experiment environment,This catalog is

C:mYsqldata

Find the subdirectory of corresponding database name

C:mYsqldataTestA

Stickup copy falls to the Data catalog of HostB,It is HostA the document that issues with catalog of HostB Mysql data is same

The PhpMyAdmin of refresh HostB looks carefully at database list,We see TestA has appeared,And make inquiry revise it is normal to wait for an operation,Backup restores to restore to succeed

Trial verdict:The database of Mysql can be saved through file form,Backup,Restore to want to restore corresponding file directory only can,Need not use other tool to back up.

Two, standard method (the government suggests) :

Derive the Mysqldump tool that should use MySQL,Main use is:
Mysqldump [OPTIONS] Database [tables]

If you do not give any lists,Whole database will be derived.

Through carrying out Mysqldump- - Help,The option that you can receive the version of your Mysqldump supports is expressed.

Notice,If you run Mysqldump- - Quick or- - Opt option,Mysqldump will be in derive lade before the result whole result collect in memory,If you are deriving a big database,This will be likely it is a problem.
Mysqldump supports following options:

- - Add-locks

LOCK TABLES increases before every watch derives and later UNLOCK TABLE.(Insert MySQL) quickly to make.

- - Add-drop-table

A Drop Table increases before every Create statement.

- - Allow-keywords

The row name that allowing to found is a keyword.This is accomplished by the method that adds watch name in front of row name.

- C, - - Complete-insert

Use complete Insert statement (the name that use a line) .

- C, - - Compress

If client and server all support,compress,Compress both an all information.

- - Delayed

With INSERT DELAYED the command is inserted row.

- E, - - Extended-insert

Use brand-new much travel INSERT is syntactic.(give out more constrictive and faster parenthesis sentence)

- # , - - Debug[=option_string]

The use of trace program (to debug) .

- - Help

Show one helps a news and exit.

- - Fields-terminated-by= . . .

- - Fields-enclosed-by= . . .

- - Fields-optionally-enclosed-by= . . .

- - Fields-escaped-by= . . .

- - Fields-terminated-by= . . .

These choices and - T choice is used together,And have the meaning with same clause of corresponding LOAD DATA INFILE.

LOAD DATA INFILE is syntactic.

- F, - - Flush-logs

Before beginning to derive,Wash the log file in MySQL server.

- F, - - Force,

Although we are in,error of a SQL gets during a watch derives,Continue.

- H, - - Host= . .

The MySQL server from named leader derives data.Default lead plane is Localhost.

- L, - - Lock-tables.

To begin to derive the lock decides all watches.

- T, - - No-create-info

Do not write a watch to establish information (CREATE TABLE statement)

- D, - - No-data

Any travel information that do not keep a watch.If you are only conceivable of the structure of a watch derive,This is very useful!

- - Opt

With- - Quick- - Add-drop-table- - Add-locks- - Extended-insert- - Lock-tables.

Should be those who read in server of a MySQL to you as far as possible the fastest derive.

- Pyour_pass, - - Password[=your_pass]

The password that when joining with the server, uses.If you are not appointed " =your_pass " part,The password that Mysqldump needs to come from terminal.

- P Port_num, - - Port=port_num

The TCP/IP port name that when joining with a lead plane, uses.(this is used at receiving the leader beyond Localhost repeatedly,Because it uses word of Unix dowel joint.)

- Q, - - Quick

Not amortize inquires,Derive directly to Stdout;Use Mysql_use_result() does it.

- S /path/to/socket, - - Socket=/path/to/socket

When joining with Localhost (it is default lead plane) document of use dowel joint word.

- T, - - Tab=path-to-some-directory

Given to every express,Found file of a Table_name.sql,It includes SQL CREATE to command,With file of a Table_name.txt,It includes data.Notice:When this has the same table machine that runs in Mysqld to guard a process to move in Mysqldump to go up only, just work.The format basis of.txt file- - Fields-xxx and- - Lines- - Xxx option will decide.

- U User_name, - - User=user_name

When joining with the server,The user name that MySQL uses.The Unix that default value is you logs onto a name.

- O Var=option, - - Set-variable Var=option

The value that sets a variable.Likely variable is in by the row below.

- V, - - Verbose

Expatiatory mode.More information that print a program place to do.

- V, - - Version

Information of the version that print and exit.

- W, - - Where='where-condition'

Derive only the record that was chosen;Noticing quote is compulsive!

Noticing quote is compulsive!- - Where=user='jimf'%26quot; %26quot;-wuserid%26gt;1%26quot; %26quot;-wuserid%26lt;1 %26quot;

A backup that the commonnest Mysqldump uses a likelihood to make whole database:
Mysqldump- - Opt Database%26gt;Backup-file.sql

But it comes from the information at a database to enrich another MySQL database to using also is useful:
Mysqldump- - Opt Database | Mysql- - Host=remote-host -C Database

Because Mysqldump derives is complete SQL statement,Used Mysql client program to be able to guide data very easily so:
Mysqladmin Create Target_db_name
Mysql Target_db_name%26lt;Backup-file.sql

...

My SQL makes mistake code and make mistake information contrasts

Of My SQL make mistake acting stopwatch,Be arranged according to the head file Mysql/include/mysqld_error.h of My SQL and become.Wrong place,Ask authority point out mistakes so that they can be corrected.

1005:Found watch failure

1006:Found database failure

1007:The database already existed,Found database failure

1008:The database is nonexistent,Cutout fails except the database

1009:Cannot delete database file to bring about cutout to fail except the database

1010:Cannot delete data catalog to bring about cutout to fail except the database

1011:Cutout fails except database file

1012:Cannot read the record in taking a system to express

1020:The record already was revised by other user

1021:The space is not worth hard disk the rest,Increase hard disk to be able to use a space please

1022:Key word repeats,Change record failure

1023:The mistake happens when shutting

1024:Read file mistake

1025:The mistake happens when changing a name

1026:Write file mistake

1032:The record is nonexistent

1036:Data table is read-only,Cannot undertake modification to it

1037:Systematic memory is insufficient,Restart please database or restart server

1038:At the memory inadequacy of sort with,Increase sort buffer please

1040:The biggest join that already arrived at a database is counted,Increase a database to be able to use join number please

1041:Systematic memory is insufficient

1042:Invalid leader name

1043:Invalid join

1044:Current user did not visit the attributive of the database

1045:Cannot join database,User name or password are wrong

1048:The field cannot is empty

1049:The database is nonexistent

1050:Data table is bad already

1051:Data table is nonexistent

1054:The field is nonexistent

1065:Invalid SQL statement,SQL statement is empty

1081:Cannot establish Socket link

1114:Data list is full already,Cannot hold any records

1116:The data table that open is too much

1129:The database appears unusual,Restart please database

1130:Join database fails,Without the attributive of join database

1133:Database user is nonexistent

1141:Current user has no right to visit a database

1142:Current user has no right to visit data table

1143:Current user has no right to visit data to express medium field

1146:Data table is nonexistent

1147:Did not define the visit limits of authority that the user expresses to data

1149:SQL statement solecism

1158:Network mistake,Occurrence misread by accident,Inspect network join condition please

1159:Network mistake,Read overtime,Inspect network join condition please

1160:Network mistake,Occurrence clerical error by accident,Inspect network join condition please

1161:Network mistake,Write overtime,Inspect network join condition please

1062:Field value repeats,Put in storage fails

1169:Field value repeats,Newer record fails

1177:Open data to express failure

1180:Refer clerical failure

1181:Time roll clerical failure

1203:The biggest join that the link that current user and database establish already arrived at a database is counted,Increase practicable database to join is counted or restart please database

1205:Add lock overtime

1211:Current user did not establish the limits of authority of the user

1216:External key tie examines failure,Newer child souvenir records failure

1217:External key tie examines failure,Delete or revise advocate souvenir records failure

1226:The resource that the resource that current user uses already allowed more than,Restart please database or restart server

1227:Attributive is insufficient,You have no right to undertake this is operated

1235:My SQL version is too low,Do not have this function

...
« 首页...« 1 2 3 4 5 6 7 8 9 »...尾页 »