In the note of the installation on the server, use MySQL
Tuesday, March 03, 2009 by rain
? ? should install MySQL, the newest version that should want to obtain it of course above all,Although everybody knows,MySQL can be found in the Packages of FreeBSD,But I or the MySQL that suggest everybody seeks newest version to the network.I introduce everybody to download to Http://www.mysql.org,Here
newest version is MySQL 3.23 Versions.
Two, the note that installs MySQL moment?
1, if you are with MySQL+Apache,The word that those who use is FreeBSD network operating system,You should press installation moment the version issue that notices FreeBSD,Say originally in the 3 the following edition of FreeBSD,It is normal that the MIT-pthread with embedded MySQL Source moves,But in this version above,You must be usedNative Threads, the option that adds a With-named-thread-libs=-lc_r namely.
2, if you are in COMPILE process,gave an issue,Whether is the Gcc version that checks you first please 2.81 version above,Whether is Gmake version 3.75 above.
3, if not be the problem of version,The memory that may be you then is insufficient,Use please. / Configure- - With-low-memory will join.
4, if you want to do your Configure afresh,So you can key in Rm Config.cache and Make Clean to keep clear of record.
5, we install MySQL in commonly / below Usr/local catalog,This is default value,You also can need the list that you install set according to yours.
Three, start and stop MySQL
If ? ? never has installed the word of MySQL on your machine,When installing MySQL,The last the command that key in is / Usr/local/mysql-3.23X/scripts/mysql_install_db
If you are the word that installs much station machine at the same time,You can compile this record,The has set each limits of authority that can make you convenient so.
1, installing catalog / the Usr/local Mysql that start can be used / Usr/local/share/mysql/mysql.server Start remembers installing the attribute of Mysql.server into 777
2, should stop Mysql Daemon to be able to be used / Usr/local/bin/mysqladmin Shutdown will come true
3, if your Mysql had installed a password,You must use Mysqladmin -u Root -p Shutdown to come true
Four, the use person that builds a MYSQL with Root
You need ? ? to record a machine with Root first,Change catalog to access attributive Chown -R Mysql /usr/local/var next,Alter Mysql.server record then,This file is located in / below Usr/local/share/mysql/ ,Change Mysql_daemon_user=root into Mysql_daemon_user=mysql.
But after increasing database newly later,Remember the relevant archives you accessing attributive to change the past:Chown -R Mysql /usr/local/var/some_new_dbs
If you hope your computer starts time Mysql of automatic to load,You should be in only / Etc/rc.local joins group / Usr/local/mysql/share.server Start
Five, the Mysql that checks you
After ? ? starts Mysql,You can use Ps -aux to check,You discover much the syntactic general survey that MYSQL of two Process ? uses
String type---STRINGS
Of string matching must be didymous,For example:
' MY IS OCP '
" MY IS OCPISCAI "
They must be it is to use ' ' or " " will express!
We will cite a few case that contain only quote and double quote inside string,For example:
Repeat double quote:
Mysql%26gt;select %26quot; Hi! " " Ocp " " ! "
- %26gt; Hi! " Ocp " !
Because a lot of only quote and double quote are contained in our HTML network,So program
Can encounter some of problem that makes mistake because of only quote and double quote here,Should try to take care so.
?
Digital type---NUMBERS
A few lawful numbers express kind in light of us:
7
777
- 777
77.77
77.777
- 777.7777o+7
Of data-base name a problem,TATBLE, INDEX, COLUMN, and of ALIAS NAME it is OK to name a principle the number as initial,Can have a bottom line,But cannot be a number completely.As far as possible avoid to use $ character,In MYSQL $ character is completely lawful,Do not pass even if be met and PHP is promiscuous,So as far as possible unused is good.In name in cannot have " . " character.ALIAS NAME can use 256 character,The length of other is restricted commonly inside 60 character.The length that you can revise MYSQL_INSTALL_DB to need your place to revise according to your him need changes,When changing, the attention does not change too too exaggerative,MYSQL data-base is to be able to support,But I had not tried the core of MYSQL,Perhaps can appear mistake.
?
Numeric function:When numeric function makes mistake,Those who pass is NULL
LOG10 (X) :Be worth with the 10 LOG that are a bottom
Mysql%26gt;SELECT LOG (EXP (1) ) ;
- ? .000000
EXP (X) :The X that passes an E second square,Among them the truth of a matter that E is NATURAL LOG.
FLOOR (X) :Pass be less than those who be equal to X the biggest integer.
CEILING (X) :The smallest integer that passes a heavy rain to be equal to X.
ROUND (X) :Round arrives integral.
MOD (N,M) or % :Take N to divide the remainder with M.
SIGN (X) :X is more than pass 1,X is equal to 0 pass 0,X is less than 0 pass - 1.
ABS (X) :Take absolute value.
ROUND (X,D) :Round arrives D fraction.D is equal to 0 with ROUND (X) identical.
Trigonometric function:
ATAN (X,Y) :Return trigonometric function
ATAN2 (X,Y) :Return trigonometric function
LEAST (X,Y,...) :At least two parameter,Pass the smallest cost.
GREATEST (X,Y,...) :At least two parameter,Send a maximum.
DEGREES (X) :Changeover radian (RADIAN) to degree.
RADIANS (X) :Change degree to radian.
...