Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

mysql±àÒë°²×°Óë²ÎÊý

mysql ±àÒë°²×°Óë±àÒë²ÎÊý
Ìí¼Ómysql×éºÍmysqlÓû§
 
[root@centos mysql]# groupadd mysql
[root@centos mysql]# useradd -g mysql mysql
 
±àÒëÓë°²×°
 
tar -zxvf mysql-5.1.35.tar.gz
./configure \
--prefix=/usr/local/mysql \
--localstatedir=/data/mysql/data \    mysqlÊý¾ÝĿ¼
--enable-assembler    \
--with-mysqld-ldflags=-rdynamic \
--with-client-ldflags=-all-static \
--with-plugins=innobase,partition \
--with-extra-charsets=none \
--enable-thread-safe-client \
--with-client-ldflags=-all-static \ ÒÔ´¿¾²Ì¬·½Ê½±àÒë¿Í»§¶Ë
--with-mysqld-ldflags=-all-static  ÒÔ´¿¾²Ì¬·½Ê½±àÒë·þÎñ¶Ë
make && make install
 
--enable-thread-safe-client \ÒÔÏ̷߳½Ê½±àÒë¿Í»§¶Ë
mysqlĿ¼ȨÏÞÉèÖÃ
 
mkdir /usr/local/mysql/var
mkdir /var/run/mysqld
chmod +w /usr/local/mysql/
chown -R mysql:mysql /usr/local/mysql/
chown -R mysql:mysql /var/run/mysqld
cp /usr/local/mysql/share/mysql/my-innodb-heavy-4G.cnf /etc/my.cnf
 
 
ÒÔmysqlÓû§³õʼ»¯Êý¾Ý¿â±í
 
/usr/local/mysql/bin/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/data --user=mysql
--datadir=/data/mysql/data  ¶¨ÒåmysqlÊý¾Ý´æ·ÅĿ¼
 
×¢Òâ:Èç¹û°ÑÊý¾ÝĿ¼¶¨Òåµ½ÆäËüĿ¼Àï,µÃÏÈÐÞ¸Ä/etc/my.cnfÎļþ,¼ÓÉÏÒÔ϶þÐÐ
 
[mysqld]
# generic configuration options
port            = 3306
socket          = /tmp/mysql.sock
# wb config
basedir = /usr/local/mysql            ×ÖÒåmysql³ÌÐòĿ¼
datadir = /data1/mysql/data         ¶¨ÒåÊý¾ÝĿ¼
 
ÔÚ¶ÔÊý¾Ý¿â½øÐгõʼ»¯±í,²»È»mysqlÊý¾Ý¿âÆô¶¯»á±¨´í.
 
Æô¶¯mysql·þÎñ
/usr/local/mysql/bin/mysqld_safe  --user=mysql --datadir=/data/mysql/data  (Ö¸¶¨Êý¾Ý¿âĿ¼)
 
/usr/local/mysql/bin/mysqld_safe --user=mysql 2>&1 > /dev/null &


Ïà¹ØÎĵµ£º

ÈçºÎÐÞ¸Ämysql rootÃÜÂë

1¡¢±à¼­MySQL(ºÍPHP´îÅäÖ®×î¼Ñ×éºÏ)ÅäÖÃÎļþ£º
windows»·¾³ÖУº%MySQL(ºÍPHP´îÅäÖ®×î¼Ñ×éºÏ)_installdir%\my.ini¡¡//Ò»°ãÔÚMySQL(ºÍPHP´îÅäÖ®×î¼Ñ×éºÏ)°²×°Ä¿Â¼ÏÂÓÐmy.ini¼´MySQL(ºÍPHP´îÅäÖ®×î¼Ñ×éºÏ)µÄÅäÖÃÎļþ¡£
linux»·¾³ÖУº/etc/my.cnf
ÔÚ[MySQL(ºÍPHP´îÅäÖ®×î¼Ñ×éºÏ)d]ÅäÖöÎÌí¼ÓÈçÏÂÒ»ÐУº
skip-grant-tables
......

MySQL³£ÓÃÄÚÖú¯Êý

1£º ASCII(str) ¡¡·µ»Ø×Ö·û´®strµÄµÚÒ»¸ö×Ö·ûµÄASCIIÖµ(strÊÇ¿Õ´®Ê±·µ»Ø0) mysql> select ASCII('2'); ¡¡¡¡-> 50 mysql> select ASCII(2); ¡¡¡¡-> 50 mysql> select ASCII('dete'); ¡¡¡¡-> 100
2£ºORD(str) ¡¡Èç¹û×Ö·û´®str¾äÊ×Êǵ¥×Ö½Ú·µ»ØÓëASCII()º¯Êý·µ»ØµÄÏàֵͬ¡£¡¡Èç¹ûÊÇÒ»¸ö¶à×Ö½Ú×Ö·û,ÒÔ¸ñʽ·µ ......

ÓÅ»¯MySQLÊý¾Ý¿âÐÔÄܵļ¸¸öºÃ·½·¨

1¡¢Ñ¡È¡×îÊÊÓõÄ×Ö¶ÎÊôÐÔ
¡¡¡¡MySQL¿ÉÒԺܺõÄÖ§³Ö´óÊý¾ÝÁ¿µÄ´æÈ¡£¬µ«ÊÇÒ»°ã˵À´£¬Êý¾Ý¿âÖеıíԽС£¬ÔÚËüÉÏÃæÖ´ÐеIJéѯҲ¾Í»áÔ½¿ì¡£Òò´Ë£¬ÔÚ´´½¨±íµÄʱºò£¬ÎªÁË»ñµÃ¸üºÃµÄÐÔÄÜ£¬ÎÒÃÇ¿ÉÒÔ½«±íÖÐ×ֶεĿí¶ÈÉèµÃ¾¡¿ÉÄÜС¡£ÀýÈ磬ÔÚ¶¨ÒåÓÊÕþ±àÂëÕâ¸ö×Ö¶Îʱ£¬Èç¹û½«ÆäÉèÖÃΪCHAR(255),ÏÔÈ»¸øÊý¾Ý¿âÔö¼ÓÁ˲»±ØÒªµÄ¿Õ¼ä£¬ÉõÖÁÊ ......

mysql 5.0´æ´¢¹ý³Ìѧϰ×ܽá

mysql 5.0´æ´¢¹ý³Ìѧϰ×ܽá
Ò».´´½¨´æ´¢¹ý³Ì
1.»ù±¾Óï·¨£º
create procedure sp_name()
begin
………
end
2.²ÎÊý´«µÝ
¶þ.µ÷Óô洢¹ý³Ì
1.»ù±¾Óï·¨£ºcall sp_name()
×¢Ò⣺´æ´¢¹ý³ÌÃû³ÆºóÃæ±ØÐë¼ÓÀ¨ºÅ£¬ÄÄŸô洢¹ý³ÌûÓвÎÊý´«µÝ
Èý.ɾ³ý´æ´¢¹ý³Ì
1.»ù±¾Óï·¨£º
drop procedure sp_na ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ