Feed on
Subscription

The user account of MYSQL database manages ABC (1)

Administrator of ? ? MySQL should know to be able to join how through appointing what user server, have link from where,And what to do when join,Will set date of MySQL user Zhang.The statement that MySQL3.22.11 introduced two to have this job more easily:GRANT statement founds MySQL user and appoint its attributive,REVOKE statement deletes attributive.The front that the accredit in appropriative Mysql database expresses these two statements,Offer operate directly these optional methods that express content.GRANT and effect of REVOKE statement are expressed four times below:

? ? accredit expresses content

Any global prerogatives that ? ? User can join the user of the server and they are had

The prerogative of database class of ? ? Db

? ? Tables _ Priv expresses class prerogative

? ? C O L Um N S _ Priv lists class prerogative

? ? still has the fiveth accredit to express (Host) ,But the effect that it does not suffer GRANT or REVOKE.

When ? ? issues GRANT statement for a certain user when you,One should be founded for this user in User watch.If this statement assigned privilege of all overall situation (administrative limits of authority or the limits of authority that are used at all databases) ,Criterion these designation also be by the record in User watch.If appointed the attributive of database, watch or row,They are the record in Db, Tables_priv and Columns_priv watch.

? ? use GRANT and REVOKE sentence are lighter than revising accredit to express directly.But,Suggest you had better complement through reading the 12nd rule the content of this chapter,The bat around in the 12nd chapter accredit is expressed.These watches are very important,Serving as an administrator to should know these tables is how to be what GRANT and go to work of form of REVOKE statement make.

The Zhang number that ? ? will discuss below the section how to install MySQL user partly originally and accredit,How to still cancel the introduction attributive and delete all user from inside accredit watch,The difficult problem that and will consider puzzles a lot of new MySQL managers.

You consider ? ? even use Mysqlaccess and Mysql_setpermission script,They are the component that MySQL issues a package.These script that are Perl,The substitute that they provided the GRANT statement that sets user Zhang date.The supportive environment that Mysql_setpermission needs to have DBI.

? ?Found new user and accredit

The grammar of statement of ? ? GRANT is as follows:

? ? GRANT Privileges (columns)

? ? ON What

? ? TO User IDENTIFIEDBY "password "

? ? WITH GRANT OPTION

? ? should use this statement,Need fills in to be divided with bottom:

The attributive of user of admeasure of cent of ? ? Privileges.Next watches listed the limits of authority that can use in GRANT statement shows symbol:

? ? attributive shows the operation that accord with attributive allows


...

In Mysql express use method to explain temporarily

When working to go up in very big list,The small subclass that you may need to run a lot of inquiry to obtain a mass data now and then,Either run these inquiry to whole watch,The minority that allows MySQL to find out place to need every time however is recorded,the record the choice reachs to express a likelihood temporarily some faster,Next these many watches run inquiry.

...

With MySQL built-in and duplicate function optimizes usability

? ? is in Soundbreak we everyday 24 hours of uninterrupted ground broadcast frequency of what is actually happening and video,So to the adds newly duplicate character of MySQL,We cannot be made make a person very much the test of be convinced.Through checking us to discover,Can use this character to maintain data synchronism with backup database server,Such becoming advocate when the server handles be no longer in force because of some kind of reason,Can use backup machine to handle all inquiry.To such requirement,It is not difficult to configure two servers.My general bat around is whole handle a process,Discuss to become at the same time advocate when server invalidation,How to use PHP to weigh directional inquiry.

Interior of ? ? MySQL is duplicate the function is to build be in two or between two above server,Adopt set between them advocate - will come true from the relation.Among them one is made give priority to a server,Of other as from the server.How do I configure bat around two servers,Set give priority to a server,Another is set for from the server.And be described the process is handled in what switch undertakes between them.I am the configuration setting process that has on the 3.23.23 version of MySQL,The test that and also be has on this version.Proposal of MySQL development staff had better use newest version,And advocate - all use identical version from the server.At the same time MySQL 3.23 version remains Beta test version,And this version cannot is down possibly compatible.So because of this reason,In actual website,I had not used this version now.Having fault tolerance ability to have a profit is,Below the condition that does not need to suspend any inquiry,Undertake upgrading to the server.

The first pace:Configuration advocate server
? ? is in of this article in leaving space,My general appoints two servers.A (IP is 10.1.1.1) make give priority to a server (abbreviation is lead plane) .B (IP is 10.1.1.2) as mothball server (abbreviation is equipment aircraft) .

The implementation process of the duplicate function of ? ? MySQL is:Equipment aircraft (B) and lead plane (A) joins,Numerate next the binary system of lead plane updates a daily record,Incorporate the change that produce again from already in the database.Equipment aircraft needs an user account to join with lead plane,Establish an account on lead plane so,Give it FILE limits of authority only,Operate as follows:

GRANT FILE ON * . * TO Replicate@10.1.1.2 IDENTIFIED BY 'password';

? ? joins with lead plane quite for equipment function,'FLUSH PRIVILEGES' should move on lead plane,Not afraid nevertheless,The server will stop in the measure below because of us.

We need ? ? now a snapshot of lead plane database,And undertake to lead plane configure,The newer daily record that allows to make a binary system.Compile 'my.cnf' document above all,So that allow a binary system to update a daily record,Be in so [of Mysqld] part below a certain place adds group:'log-bin' .Be in the next time when the server is started,Lead plane will generate a binary system to update a daily record (the name is:%26lt; leader name %26gt; - Bin. #%26gt;) of %26lt; increment serial number.Update a daily record to allow a binary system effective,Shut MySQL to serve a program,The place know exactly about sth that boards lead plane next arrives according to library catalog in another catalog,Start Mysqld afresh then.
Got all databases certainly please,When undertaking duplicating otherwise,If a watch exists on lead plane but nonexistent on equipment aircraft,Will because of make mistake and exit.The snapshot that you had gotten data now,Mix from the binary log since building snapshot,There is what any logarithms occupy a library to revise above.Notice MySQL data file please (*.MYD,*.MYI and *.frm) are those who rely on file system,So you cannot be transmitted into travel file merely,If arrive from Solaris Linux.If you are in a heterogeneous service system environment,You get the custom-built base that must use Mysqldump utility program or other data snapshot originally.

The second pace:Deploy equipment aircraft
? ? lets us continue.The MySQL that stops equipment aircraft to go up serves a program,And move the database catalog that comes from the copy on lead plane to the Data catalog on equipment aircraft fall.Affirm the owner catalog is mixed please belong to group of changes to be worth accordingly for MySQL user,And revise file mode mix to owner only for 660(belong to the group is readable, can write) ,Catalog itself is mixed to owner only for 770(belong to the group is readable, can be written and executable) .

? ? continues.On equipment aircraft the MySQL that start serves a program,It is normal to affirm MySQL works.Run a few Select to inquire (do not want Update or Insert inquiry) ,The data snapshot that has a look to get in the first pace is successful.Then,MySQL is put out to serve a program after the test is successful.

The leader that ? ? needs to visit in the configuration on equipment aircraft,So that receive leader change.The 'my.cnf' document that needs to edit Wu machine to go up so,In [increase in Mysqld] part below a few:
Master-host=10.1.1.1Master-user=replicateMaster-password=password

After ? ? is starting equipment aircraft to serve a program,Program of equipment aircraft service will examine the leader that appoints in 'my.cnf' file,Examine whether to have a change,And incorporate these changes arrive from already in the database.The newer record that equipment aircraft held lead plane,These records are receive from inside the 'master.info' file of lead plane come down.The condition of Cheng of equipment aircraft line can command through Sql 'SHOW SLAVE-STATUS' sees.If,be in on equipment aircraft in log of processing binary system
Produce a mistake,Exit those who bring about Cheng of equipment aircraft line,And be in the log file of *.err make a news.Next the mistake can be corrected,Can use Sql statement 'SLAVE START' to start Cheng of equipment aircraft line afresh then.Line Cheng continues the place that interrupts from processing of log of lead plane binary system to handle.

? ? so far,On lead plane the data change of place happening should have duplicated to go up to equipment aircraft,Should check it,You can be inserted on lead plane or update a record,And on equipment aircraft the choice is recorded this.

We had ? ? to arrive from A machine now of B machine this kind advocate - from the relation,May become when A machine so machine when,Allow us to weigh all inquiry directional go up to B machine,But when A machine restores,The change that we will produce without method restores to go in A machine.To solve this problem,We are founded arrive from B machine of A machine advocate - from the relation.

...

How be installed and check MySQL

A kind of when PHP+MySQL+Linux already became small-sized Web server gradually at present classical combination.A kind of first selection that be built below Windows environment and debugging MySQL database is a lot of website developer.Oneself issue MySQL of begin to learn in Windows98 environment,Come out learning process and experience summary to consult for everybody now.
1, download Mysql-3.23.35-win.zip and solution is pressed;
2, moving Setup.exe; chooses D:\Mysql, "Tyical Install "
3, the Mysql that start,Be like lower part law:

Method one:Use Winmysqladmin
1) , enter D: \mysql\bin catalog,Moving Winmysqladmin.exe,In screen right the meeting inside the task column of next horn has an erubescent plan accord with
Wrong key of 2) , mouse clicks this graph accord with,Choose " Show Me " ,Appear " WinMySQLAdmin " operation interface;The user name that a dialog box can appear to the requirement is inputted and install you among the meeting when moving first and countersign
3) , choice " My.INI Setup "
4) , in " Mysqld File " be chosen choose " Mysqld-opt " (Win9x) or " Mysqld-nt " (WinNT)
5) , choice " Pick-up Or Edit My.ini Values " can be opposite inside right window your My.ini file has an edition
6) , choice " Save Modification " the My.ini file that saves you
7) , when if you want to use Winmysqladmin(quickly,switching on the mobile phone move automatically) ,Choose " Create ShortCut On Start Menu "
8) , test:
Enter DOS interface;
In D:\Mysql moves below Mysql\bin catalog,Enter Mysql to operate an interface interactively
Input Show Databases and carriage return,Screen is shown current already some two databases Mysql and Test

Method two:Do not use Winmysqladmin

1) , below DOS window,Enter D:/mysql/bin list
Below 2) , Win9X) move: Mysqld
Move below NT: Mysqld-nt- - Standalone
3) , after this,Mysql backstage moves
?of Mysql: of 4) , test? ?: / below Mysql/bin catalog)Show when A) , Mysqlshow is normal already some two databases Mysql and TestFive lists in database Mysql show when B) , Mysqlshow -u Root Mysql is normal:


...

Let MySQL and OpenOffice in all dance

? ? a year ago,A when I became Linux user,But old use Windows,Let me feel some Linux tools are used not very habit.Take a database for,Below Windows,The website that develops drive of a few databases can choose to use Access when system of small-sized perhaps management.Access is used easily not only,And very convenient.After turning to Linux,When doing same business, discover MySQL is a right choice,But its do not have graphical interface,Use rising is not very convenient,Then the hope can find settlement program.Pass period of time seek,Found eventually settle way,Use MySQL and OpenOffice band namely.Show according to the data,The method that implementation MySQL and OpenOffice work in coordination has a lot of to plant,Nevertheless mostly too complex,Be hard to come true.Here I introduce two kinds of installation and configuration course.

The operating system that I use ? ? is Red Hat 8.0,The emission that same method uses at other edition is likely have a bit different.In how rigging buy process,Need MySQL and UnixODBC software package (had installed below OpenOffice default circumstance) .These software packages had been taken oneself in the CD of Red Hat 8.0,But in my test,Use installation dish the method cannot succeed it seems that.

? ?Installation deploys a method one



? ? 1. Download software

The software package that ? ? place needs has:


...

How to retrieve data from inside MySQL database watch

1, retrieve information from inside database watch

Actually,We had used SELECT statement in front,It is used retrieve information from inside database watch.Select statement form is commonly:
The watch WHERE that FROM of keyword of SELECT retrieval is retrieved retrieves a condition (optional)
What use previously " * " express to choose all lines.
Continue to use us below going up a watch Mytable that founds in the article.

2, inquire all data:


...

Found database and database watch with MySQL

1, use SHOW statement finds out current on the server presence what database:





mysql%26gt; SHOW DATABASES; 
+----------+
| Database |
+----------+
| mysql |
| test |
+----------+
3 rows in set (0.00 sec)
...

The database designs model form explain the profound things in a simple way

The regulation with should be abided by certain is when relation database is designed.Especially the database designs model type to introduce 1NF simply now (the first model type) ,2NF (the second model type) ,3NF (the third model type) with BCNF,Have the fourth additionally after model type stays with the fiveth model type, introduce again.The database is designed in you when,If can accord with these a few model type,The ace that you are database design.

...

The administrative tool of LINUX network function three swordsman (1)

The article that the article is skill of function of network of system of introductory management Linux,Basically introduced Route, Netstat, Tcpdump the use method of tool of test of three kinds of network management and its realizable function.

Route

When configuring a network,Should appoint for the machine the way that wants a course should be wrapped when receiving data to wrap.In Linux system,Offer Route of a command,The net card that this command can think Ifconfig commands configuration sets static way by.Job of this kind of setting is in normally / introduce in Etc/rc.d/rc.inet1,Undertake when systematic guiding.

We explain how to use Route to command through a few example:Route Add -net 127.0.0.0

This command general to the road by one is added to appoint an address in the watch or the road of the network by.Notice right now the network is A kind address,Code of attack by surprise is by the setting 255.0.0.0,This new additive entry is gone to by join on Lo equipment.
Route Add -net Xxx.xxx.xxx.xxx Netmask 255.255.255.0 Dev Eth0

This lead plane that commands the address that it is IP is Xxx.xxx.xxx.xxx adds a way by,Code of its network attack by surprise is by the setting 255.255.255.0.
Route Del -net Xxx.xxx.xxx.xxx

This command will delete Xxx.xxx.xxx.xxx the road of this network by.

Use Route command is OK still very undertake administrative by information to the road of whole network conveniently,The road that its output a result is a network by the watch.Following place are shown:


...

MySQL data guides derive tool Mysqlimport brief introduction

? ?1) the grammar introduction of.mysqlimport:

? ? Mysqlimport is located in in Mysql/bin catalog,One be Mysql loads (perhaps say to guide) a of data very effective tool.This is tool of travel of a command.Two parameter and many options can offer an alternative.This tool file of a text (Text File) in the database that guides you are appointed and watch.In saying we want to guide data into the watch Custermers in database Meet_A_Geek from inside file Customers.txt for example:
? ? Mysqlimport Meet_A_Geek Customers.txt
? ? notices:Customers.txt is we should guide here the text file of data,And Meet_A_Geek is the database that we should operate,
The watch name in ? ? database is Customers,The data format of here text file must agree with the format in Customers watch,Otherwise Mysqlimport command will make mistake.The name that expresses among them is to guide the first full stop of the file (. ) in front file string,Another example:
? ? Mysqlimport Meet_A_Geek Cus.to.mers.txt
? ? so we will guide the content in the file into the Cus watch in database Meet_A_Geek.
In the example above ? ? ,Use two parameter only,Did not use more option,The option of Mysqlimport introduces below
? ?
? ?2) the commonly used option of.mysqlimport introduces:

Function of ? ? option
? ? - D Or- - Delete new data guides data data is deleted to express all medium information before data table is medium
? ? - F Or- - no matter whether Force encounters a mistake,Mysqlimport will continue compulsively to insert data
? ? - I Or- - Ignore Mysqlimport is jumped over or those have oversight the travel of identical and only key word,Guide the data into the file will by oversight.
? ? - before data of L Or -lock-tables is inserted, chain watch,Prevented so,When you are updating a database,The inquiry of the user and be affected newlier.
? ? - R Or -replace this option and - the effect of I option is adverse;This option records what there is identical and only key word in replacing a list.
? ?- - Fields-enclosed- By= Char
When ? ? appoints the record of the data in text file, rise with what draw together,The data below a lot of circumstances rises with double quote draw together.The data below acquiescent circumstance is to do not have what be removed by character draw together.
? ?- - Fields-terminated- By=char
The separator between the value that ? ? assigns each data,In the file of full stop space,Separator is full stop.You can appoint the separator between data with this option.Acquiescent separator is to jump case accord with (Tab)
? ?- - Lines-terminated- By=str
? ? this option appoints the travel in text file and travel between the disjunctive string of data or character.The Mysqlimport below acquiescent circumstance is a separator with Newline.You can choose to replace a single character with a string:Go newly or a carriage return.
The option with commonly used command of ? ? Mysqlimport still has - V shows version (Version) ,- P clew inputs a password (Password) etc.
? ?
? ?3) . Example:Guide one is the file of separator with comma

The format of the travel in ? ? file is such:
? ? "1" , "ORD89876" , "1 Dozen Roses" , "19991226 "
? ? our task is to want to guide the data inside this file into the form Orders in database Meet_A_Geek,We use this order:
Fields-terminated-by= of - of Fields-enclosed-by=" of - of Prl of - of ? ? Bin/mysqlimport, meet_A_Geek Orders.txt
? ? commands the likelihood looks this very accurate,After was familiar with when you nevertheless,This is very simple.The first part,Bin/mysqlimport, telling an operating system you want the order that move is the Mysqlimport below Mysql/bin catalog,Option P is requirement input password,Ask you are altering so the password is inputted before the database,The operation rises the meeting is safer.Because we want a list,we used R option is the data in there is the record that repeats only key word to replace a document in medium only key word and file record.We express the data in sheet is not newest,The data in needing to use a document goes updating,Use R consequently this option,In replacing a database already some records.The action of L option is chain when we insert data watch,The operation that when preventing an user to replace a list in us so, has inquire or be changinged to the watch.

...
« 首页...« 3 4 5 6 7 8 9 10 11 12 13 14 15 16 »...尾页 »