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

¾ßÓиºÔؾùºâ¹¦ÄÜMySQL·þÎñÆ÷¼¯Èº²¿ÊðʵÏÖ

ÕªÒª£ºMySQLÊÇÒ»¸ö¸ßËٶȡ¢¸ßÐÔÄÜ¡¢¶àÏ̵߳ĹØϵÐÍÊý¾Ý¿â¹ÜÀíϵͳ£¬ÊÊÓÃƽ̨¶à£¬¿ÉÀ©Õ¹ÐÔÇ¿¡£ÔÚʵ¼ÊÉú²ú»·¾³ÖУ¬²¿ÊðºÍʵÏÖ¾ßÓÐÒ»¶¨¸ºÔؾùºâ¹¦ÄܵÄMySQL·þÎñÆ÷
¼¯Èº£¬¶ÔÓÚÌá¸ßÓû§Êý¾Ý¿âÓ¦ÓÃϵͳµÄÐÔÄÜ¡¢ËٶȺÍÎȶ¨ÐÔ¾ßÓÐÃ÷ÏÔµÄ×÷Óᣱ¾ÎļòÒª½éÉÜÁËÔÚFreeBSD
7.0-ReleaseϵͳÉϲ¿ÊðʵÏÖMySQL·þÎñÆ÷
¼¯ÈºµÄ·½°¸£¬²¢¶Ô¿ÉÄܳöÏÖµÄÎÊÌâÌṩÁËÏàÓ¦µÄ½â¾ö·½·¨¡£
    1. ÒýÑÔ
¡¡¡¡MySQLÊÇÒ»¸ö¸ßËٶȡ¢¸ßÐÔÄÜ¡¢¶àÏ̡߳¢¿ª·ÅÔ´´úÂ룬½¨Á¢ÔÚ¿Í»§/·þÎñÆ÷(Client/Server)½á¹¹ÉϵĹØϵÐÍÊý¾Ý¿â¹ÜÀíϵͳ(RDBMS)¡£ËüʼÓÚ1979Ä꣬×î³õÊÇMichael
WideniusΪÈðµäTcX¹«Ë¾´´½¨µÄUNIREGÊý¾Ý¿âϵͳ£¬µ±Ê±µÄUNIREGûÓÐSQL(Structured Query
Language½á¹¹»¯²éѯÓïÑÔ)½Ó¿Ú£¬ÏÞÖÆÁËËüµÄÓ¦Óá£1996Äê5Ô£¬Widenius¿ª·¢³öÁËMySQLµÄ×î³õ°æ±¾£¬¿ªÊ¼ÔÚInternetÉϹ«¿ª·¢ÐС£MySQLµÄ¿ª·¢ÈËÔ±´ÓÒ»¿ªÊ¼¾ÍÒ»Ö±¹Ø×¢ËüµÄÐÔÄÜ£¬Îª´Ë²»Ï§ÌØÐÔ¼¯£¬Ö±µ½½ñÌ죬MySQLÒÀÈ»±£³Ö±¾É«£¬ÒÔ¸ßËٶȸßÐÔÄÜΪÊ×ÒªÔ­Ôò¡£Ëæ×Åʱ¼äµÄÍÆÒÆ£¬MySQLÒ²¼ÓÈëÁË´óÐÍÊý¾Ý¿â²úÆ·µÄ¸ß¼¶ÌØÐÔ£¬Èç´æ´¢
¹ý³Ì¡¢ÊÓͼ¡¢´¥·¢Æ÷µÈ£¬Ê¹ÆäÔÚÆóÒµ¼¶Êý¾Ý¿âϵͳÖпªÊ¼±»²¿ÊðÓ¦ÓÃ[1]¡£2008Äê10Ô£¬SUN¹«Ë¾ÊÕ¹ºÁËMySQL
AB¹«Ë¾£¬¿ªÊ¼½øÈ뿪ԴÁìÓò¡£Ëæ×ÅÖØÁ¿¼¶²Ù×÷ϵͳSolarisµÄ¿ªÔ´£¬SUN
MySQLÔÚÊý¾Ý¿âÊг¡Õ¼Óеķݶ»á½øÒ»²½Ìá¸ß¡£Òò´Ë£¬ÔÚÉú²ú»·¾³Öв¿Êð¾ßÓиºÔؾùºâ¹¦ÄܵÄMySQL·þÎñÆ÷¼¯Èº£¬¶ÔÓÚÌá¸ßÆóÒµÊý¾Ý¿âÓ¦ÓÃϵͳµÄËٶȡ¢Îȶ¨ÐÔ¼°¿ÉÉìËõÐÔ¾ßÓкܴóµÄÏÖʵÒâÒ壬Ҳ¿ÉÒÔÓÐЧ½µµÍÓ¦ÓÃϵͳµÄͶ×ʳɱ¾¡£±¾ÎĽ«ÒÔFreeBSD
7.0-Release²Ù×÷ϵͳΪÀý£¬ÀûÓÃMySQLÊý¾Ý¿âµÄ¸´ÖÆ(Replication)ÌØÐÔ£¬¼òÒª½éÉܲ¿ÊðMySQL·þÎñÆ÷¼¯ÈºµÄʵÏÖ·½·¨ºÍÏà¹Ø×¢ÒâÊÂÏî¡£
¡¡¡¡2. ϵͳģÐÍ
¡¡¡¡±¾¼¯ÈºµÄ½á¹¹ÎªÒ»¸öÖ÷MySQL·þÎñÆ÷(Master)·þÎñÆ÷Óë¶à¸ö´ÓÊôMySQL·þÎñÆ÷(Slave)½¨Á¢¸´ÖÆ(replication)Á¬½Ó£¬Ö÷·þÎñÆ÷Óë´ÓÊô·þÎñÆ÷ʵÏÖÒ»¶¨³Ì¶ÈÉϵÄÊý¾Ýͬ²½£¬¶à¸ö´ÓÊô·þÎñÆ÷´æ´¢
ÏàͬµÄÊý¾Ý¸±±¾£¬ÊµÏÖÊý¾ÝÈßÓ࣬ÌṩÈÝ´í¹¦ÄÜ¡£²¿Ê𿪷¢Ó¦ÓÃϵͳʱ£¬¶ÔÊý¾Ý¿â²Ù×÷´úÂë½øÐÐÓÅ»¯£¬½«Ð´²Ù×÷(ÈçUPDATE¡¢INSERT)¶¨Ïòµ½Ö÷·þÎñÆ÷£¬°Ñ´óÁ¿µÄ²éѯ²Ù×÷(SELECT)¶¨Ïòµ½´ÓÊô·þÎñÆ÷£¬ÊµÏÖ¼¯ÈºµÄ¸ºÔؾùºâ¹¦ÄÜ¡£Èç¹ûÖ÷·þÎñÆ÷·¢Éú¹ÊÕÏ£¬´ÓÊô·þÎñÆ÷½«×ª»»½ÇÉ«³ÉΪÖ÷·þÎñÆ÷£¬Ê¹Ó¦ÓÃϵͳΪÖÕ¶ËÓû§Ìṩ²»¼ä¶ÏµÄÍøÂç·þÎñ;Ö÷·þÎñÆ÷»Ö¸´ÔËÐк󣬽«Æäת»»Îª´ÓÊô·þÎñÆ÷£¬´æ´¢Êý¾Ý¿â¸±±¾£¬¼ÌÐø¶ÔÖÕ¶ËÓû§ÌṩÊý¾Ý²éѯ¼ìË÷·þÎñ¡£
¡¡¡¡3. ²¿ÊðʵÏÖ
¡¡¡¡±¾ÎÄÒÔ


Ïà¹ØÎĵµ£º

java µ÷ÓÃÃüÁî ±¸·ÝmysqlÊý¾Ý¿â

 ´úÂëÈçÏ£º
  1  String command  =   " cmd /c C:/Program Files/MySQL/MySQL Server 5.0/bin>mysqldump -h localhost -u root -p aijia > E:/aijia.dmp " ;
  2      try    {
  3     Process process& ......

MySQLÐÞ¸ÄrootÃÜÂëµÄ¸÷ÖÖ·½·¨ÕûÀí


ÕûÀíÁËÒÔÏÂËÄÖÖÔÚMySQLÖÐÐÞ¸ÄrootÃÜÂëµÄ·½·¨,¿ÉÄܶԴó¼ÒÓÐËù°ïÖú
·½·¨1£º ÓÃSET PASSWORDÃüÁî
¡¡¡¡mysql -u root
¡¡¡¡mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');
·½·¨2£ºÓÃmysqladmin
¡¡¡¡mysqladmin -u root password "newpass"
¡¡¡¡Èç¹ûrootÒѾ­ÉèÖùýÃÜÂ룬²ÉÓÃÈçÏ·½·¨
¡¡¡¡mysql ......

mysqlÈÕÆÚºÍʱ¼ä¸ñʽת»»

¶ÔÓÚÿ¸öÀàÐÍÓµÓеÄÖµ·¶Î§ÒÔ¼°²¢ÇÒÖ¸¶¨ÈÕÆÚºÎʱ¼äÖµµÄÓÐЧ¸ñʽµÄÃèÊö¼û7.3.6 ÈÕÆÚºÍʱ¼äÀàÐÍ¡£
ÕâÀïÊÇÒ»¸öʹÓÃÈÕÆÚº¯ÊýµÄÀý×Ó¡£ÏÂÃæµÄ²éѯѡÔñÁËËùÓмǼ£¬Æädate_colµÄÖµÊÇÔÚ×îºó30ÌìÒÔÄÚ£º
mysql> SELECT something from table
WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) <= 30;
DAYOFWEEK(date)
·µ»ØÈÕÆ ......

mysql»ù±¾ÃüÁî

 Æô¶¯£ºnet start mySql;
  ½øÈ룺mysql -u root -p/mysql -h localhost -u root -p databaseName;
  ÁгöÊý¾Ý¿â£ºshow databases;
  Ñ¡ÔñÊý¾Ý¿â£ºuse databaseName;
  Áгö±í¸ñ£ºshow tables£»
  ÏÔʾ±í¸ñÁеÄÊôÐÔ£ºshow columns from tableName£»
  ½¨Á¢Êý¾Ý¿â£ºsource fileNam ......

mysql²éѯһÌ죬²éѯһÖÜ£¬²éѯһ¸öÔµÄÊý¾Ý

²éѯһÌ죺
select * from table where to_days(column_time) = to_days(now());
select * from table where date(column_time) = curdate();
²éѯһÖÜ£º
select * from table   where DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(column_time);
²éѯһ¸öÔ£º
select * from table where DATE_SUB(CUR ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ