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

MYSQL °²×°È«½â


Red Hat Linux Ï°²×°mysql°æ±¾³åÍ»ÎÊÌâ½â¾ö
¸ÕÅöµ½Ò»¸öÎÊÌ⣬ÓÉÓÚÔÚʹÓõÄlinux·þÎñÆ÷ÉÏÒѾ­°²×°ÁËÒ»¸ö½ÏµÍ°æ±¾µÄMySql server£¬Ê¹ÓÃrpm°ü½øÐа²×°Ê±£¬Ìáʾ°æ±¾³åÍ»£¬°²×°²»ÄܼÌÐø½øÐС£
ÓÉÓھɵÄÊý¾Ý²»ÏëÒªÁË£¬½â¾ö°ì·¨ÊÇÕâÑùµÄ£º
[b]1¡¢ÏÈ°ÑϵͳÀï°²×°µÄËùÓÐmysqlÕÒ³öÀ´[/b]
#rpm -qa | grep -i mysql ÔËÐдËÃüÁîºó£¬ÏÔʾËùÓÐÁÐ±í£º
mysqlclient10-3.23.58-4.RHEL4.1
mysqlclient10-devel-3.23.58-4.RHEL4.1
mysql-4.1.20-1.RHEL4.1
[b]2¡¢½«ÁбíһһǿÖÆɾ³ý£º[/b]
#rpm -ev --nodeps mysqlclient10-3.23.58-4.RHEL4.1
#rpm -ev --nodeps mysqlclient10-devel-3.23.58-4.RHEL4.1
#rpm -ev --nodeps mysql-4.1.20-1.RHEL4.1
[b]3¡¢½«ÀÏ°æ±¾µÄ¼¸¸öÎļþÊÖ¹¤É¾³ý£º[/b]
#rpm -f /etc/my.cnf
#rpm -rf /usr/var/lib/mysql
[b]4¡¢°²×°Ð°汾µÄmysql server:[/b]
#rpm -ivh MySQL-server-community-5.0.45-0.rhel4.i386.rpm
[b]5¡¢°²×°client£¬ÓÃÓÚÃüÁîÐÐϲÙ×÷mysql£º[/b]
#rpm -ivh MySQL-client-community-5.0.45-0.rhel4.i386.rpm
rpmÎļþÊÇRed Hat¹«Ë¾¿ª·¢µÄÈí¼þ°²×°°ü£¬rpm¿ÉÈÃLinuxÔÚ°²×°Èí¼þ°üʱÃâ³ýÐí¶à¸´ÔÓµÄÊÖÐø¡£¸ÃÃüÁîÔÚ°²×°Ê±³£ÓõIJÎÊýÊÇ –ivh ,ÆäÖÐi±íʾ½«°²×°Ö¸¶¨µÄrmpÈí¼þ°ü£¬V±íʾ°²×°Ê±µÄÏêϸÐÅÏ¢£¬h±íʾÔÚ°²×°ÆÚ¼ä³öÏÖ“#”·ûºÅÀ´ÏÔʾĿǰµÄ°²×°¹ý³Ì¡£Õâ¸ö·ûºÅ½«³ÖÐøµ½°²×°Íê³Éºó²ÅÍ£Ö¹¡£
1£©°²×°·þÎñÆ÷¶Ë
ÔÚÓÐÁ½¸örmpÎļþµÄĿ¼ÏÂÔËÐÐÈçÏÂÃüÁ
[root@test1 local]# rpm -ivh MySQL-server-5.0.9-0.i386.rpm
ÏÔʾÈçÏÂÐÅÏ¢¡£
warning: MySQL-server-5.0.9-0.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
Preparing...¡¡¡¡¡¡¡¡¡¡¡¡¡¡########################################### [100%]
1:MySQL-server¡¡¡¡¡¡¡¡¡¡########################################### [100%]
¡£¡£¡£¡£¡£¡££¨Ê¡ÂÔÏÔʾ£©
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h test1 password 'new-password'
¡£¡£¡£¡£¡£¡££¨Ê¡ÂÔÏÔʾ£©
Starting mysqld daemon with databases from /var/lib/mysql
Èç³öÏÖÈçÉÏÐÅÏ¢£¬·þÎñ¶Ë°²×°Íê±Ï¡£²âÊÔÊÇ·ñ³É¹¦¿ÉÔËÐÐnetstat¿´Mysql¶Ë¿ÚÊÇ·ñ´ò¿ª£¬Èç´ò¿ª±íʾ·þÎñÒѾ­Æô¶¯£¬°²×°³É¹¦¡£MysqlĬÈϵĶ˿ÚÊÇ3306¡£
[root@test1 local]# netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q


Ïà¹ØÎĵµ£º

¡¾Ô­´´¡¿MySQLÊý¾Ý¿â´æ´¢ÒýÇæºÍ·ÖÖ§ÏÖ×´

 
[Ô­´´] MySQLÊý¾Ý¿â´æ´¢ÒýÇæºÍ·ÖÖ§ÏÖ×´
ÔÚMySQL¾­ÀúÁË2008ÄêSunµÄÊÕ¹ººÍ2009ÄêOracleÊÕ¹ºSunµÄ¹ý³ÌÖУ¬»ù±¾´¦ÓÚÍ£ÖÍ·¢Õ¹µÄÇé¿ö£¬ÔÚ¿ÉÒÔÔ¤¼ûµÄδÀ´£¬MySQLÊǿ϶¨»á±»Oracle¸éÖò¢ÇÒÖð²½Ñ©²ØÏûÃðµôµÄ¡£MySQLËæ×ÅÏàÓ¦µÄ¸÷Ö÷´´ºÍÄÚ²¿¿ª·¢ÈËÔ±µÄÀëÈ¥£¬µÞÔìÁ˸÷¸ö²»Í¬µÄÒýÇæºÍ·ÖÖ§£¬ÈÃMySQLÓÐÏ£Íû¼ÌÐø·¢Ñï¹â´óÆðÀ´¡£
±¾ ......

mysql´´½¨Óû§È¨ÏÞÓï·¨

create database testdb; /* ´´½¨Êý¾Ý¿â */
use testdb; /* ´ò¿ªÊý¾Ý¿â */
/*grant ÆÕͨÊý¾ÝÓû§£¬²éѯ¡¢²åÈë¡¢¸üС¢É¾³ý Êý¾Ý¿âÖÐËùÓбíÊý¾ÝµÄȨÀû*/
grant select,insert,update,delete on testdb.* to common_user@'%';
grant select,insert,update,delete on testdb.* to common_user@'localhost'; ......

MySQLÖ÷´Ó·þÎñÆ÷£¨Replication£©µÄÉèÖÃ

Ê×ÏÈÉèÖÃMySQLÖ÷·þÎñÆ÷£º
ÔÚÖ÷·þÎñÆ÷ÉÏΪ´Ó·þÎñÆ÷½¨Á¢Ò»¸öÓû§£º
grant replication slave on *.* to 'Óû§Ãû'@'Ö÷»ú' identified by 'ÃÜÂë';
Èç¹ûʹÓõÄÊÇMySQL 4.0.2֮ǰµÄ°æ±¾£¬ÔòÓÃfileȨÏÞÀ´´úÌæreplication slave
±à¼­Ö÷·þÎñÆ÷µÄÅäÖÃÎļþ£º/etc/my.cnf
server-id=1
log-bin
binlog-do-db=ÐèÒª¸´ÖƵÄÊý¾Ý¿âÃû£ ......

mysql×Ó²éѯ exists,not exists


(1)ʵÏÖÈýá¹û¼¯A-½á¹û¼¯B£º--ÀûÓÃnot
exists£¬ºÏ²¢Ôò¿ÉÓÃunion
exists,not
exists£ºÓÃÓÚÅжÏÇÒ»ñÈ¡½á¹û¼¯AÊÇ·ñ´æÔڵؽá¹û¼¯BÖÐ!
==========½á¹û¼¯A£º
SELECT
d.Device_ID,d.Device_Name,a.App_ID,a.App_Name
               from
T_ ......

MySQL ·þÎñÎÞ·¨Æô¶¯ 1067 ´íÎó ½ø³ÌÒâÍâÖÕÖ¹½â¾ö·½·¨

֮ǰװ¹ýÒ»±é MySQL 5.1£¬Í¬ÑùµÄ msi °²×°Îļþ£¬Ð¶ÔØ MySQL Ö®ºó¹ý¼¸ÌìÖØÐÂ×°È´Ôõô¶¼²»ÐС£
°²×°ºÃÁËÖ®ºóÅäÖà MySQL ʵÀýµÄʱºòµ½µÚÈý²½“Start Service”Ôõô¶¼¹ý²»È¥£¬³¢ÊÔ×Ô¼ºÆô¶¯·þÎñ»òÕßÓÃÃüÁîÐÐÆô¶¯£¬¶¼Ê§°Ü£»ÉÏÍøÕÒÁËһϣ¬±ðÈËÒ»°ã¶¼Ëµ my.ini ÓÐÎÊÌ⣬³¢ÊÔÁËÒ²²»¹ÜÓá£
ÔÙ´ÎÖØ×°µÄʱºò£¬ÎÞÒâÖп´¼ûÓÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ