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

ubuntu MySQL°²×°Ö¸ÄÏ

Òª°²×° MySQL£¬¿ÉÒÔÔÚÖÕ¶ËÌáʾ·ûºóÔËÐÐÏÂÁÐÃüÁ
sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install php5-mysql
// °²×°php5-mysql Êǽ«phpºÍmysqlÁ¬½ÓÆðÀ´
Ò»µ©°²×°Íê³É£¬MySQL ·þÎñÆ÷Ó¦¸Ã×Ô¶¯Æô¶¯¡£Äú¿ÉÒÔÔÚÖÕ¶ËÌáʾ·ûºóÔËÐÐÒÔÏÂÃüÁîÀ´¼ì²é MySQL ·þÎñÆ÷ÊÇ·ñÕýÔÚÔËÐУº
sudo netstat -tap | grep mysql
µ±ÄúÔËÐиÃÃüÁîʱ£¬Äú¿ÉÒÔ¿´µ½ÀàËÆÏÂÃæµÄÐУº
tcp 0 0 localhost:mysql *:* LISTEN 11232/mysqld
Èç¹û·þÎñÆ÷²»ÄÜÕý³£ÔËÐУ¬Äú¿ÉÒÔͨ¹ýÏÂÁÐÃüÁîÆô¶¯Ëü£º
sudo /etc/init.d/mysql restart
½øÈëmysql
mysql -uroot -p
(ÊäÈëmysqlµÄrootÃÜÂë)
ÅäÖà MySQL µÄ¹ÜÀíÔ±ÃÜÂ룺
sudo mysqladmin -u root password newpassword
*****************************************************************************************************
ת×Ôhttp://wiki.ubuntu.org.cn/MySQL%E5%AE%89%E8%A3%85%E6%8C%87%E5%8D%97
*****************************************************************************************************


Ïà¹ØÎĵµ£º

mysql±¸·ÝÃüÁî


±¸·ÝÊý¾Ý¿âÃüÁî:
mysqldump -u root --password=root --database  helloworld
>helloworld_backup.sql
ÆäËûÓ÷¨:
1.µ¼³öÕû¸öÊý¾Ý¿â
mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû > µ¼³öµÄÎļþÃû  
mysqldump -u wcnc -p smgp_apps_wcnc > wcnc.sql
2.µ¼³öÒ»¸ö±í
mysqldump -u Óû§Ãû -p Êý¾Ý¿âà ......

MysqlÓû§ÃÜÂëÐÞ¸Ä

1.Ö±½ÓÔÚÊý¾Ý¿âÖÐÐ޸ļǼ
mysql> use mysql
mysql> update user set password = password(”new_password”) where user = “user_name”;
mysql> flush privileges;
ÆäʵÕâÖÖ·½·¨¾ÍÊǸüÐÂÒ»ÌõÊý¾Ý¿â¼Ç¼£¬ÓëÆÕͨupdateÓï¾ä²»Í¬µÄÊÇ£¬ÃÜÂë¼ÓÃÜ´æ´¢£¬ÐèÓÃpassword()º¯ÊýÀ´Éú³É£¬ÁíÒ»¸ö²»Í ......

mysql Ìí¼ÓÓû§µÄÃüÁî

Ò»¡¢´´½¨Óû§µÄÃüÁî
mysql> create user 'username'@'localhost' identified by 'password';
Query OK, 0 rows affected (0.06 sec)
¶þ¡¢¸øмÓÓû§ÊÚÓèȨÏÞ
mysql> grant all privileges on test.* to 'username'@'localhost';
Query OK, 0 rows affected (0.00 sec)
˵Ã÷£ºÕâÌõÃüÁîÊÚÓè username ¶ÔÊý¾Ý¿â te ......

MySQL¼Ü¹¹·½°¸(ת)

Scale Out£ººáÏòÀ©Õ¹£¬Ôö¼Ó´¦Àí½ÚµãÌá¸ßÕûÌå´¦ÀíÄÜÁ¦
Scale Up£º×ÝÏòÀ©Õ¹£¬Í¨¹ýÌáÉýµ¥¸ö½ÚµãµÄ´¦ÀíÄÜÁ¦´ïµ½ÌáÉýÕûÌå´¦ÀíÄÜÁ¦µÄÄ¿µÄ
Replication
MySQLµÄreplicationÊÇÒì²½µÄ£¬ÊÊÓÃÓÚ¶ÔÊý¾ÝʵʱÐÔÒªÇó²»ÊÇÌرð¹Ø¼üµÄ³¡¾°¡£slave¶ËµÄIOÏ̸߳ºÔð´Ómaster¶ÁÈ¡ÈÕÖ¾£¬SQLÏß ³ÌרߺÔðÔÚslave¶ËÓ¦ÓôÓmaster¶Á¹ýÀ´µÄÈÕÖ¾£¨ÔçÆÚ ......

MysqlµÄIP´¦Àíº¯Êýinet_aton()ºÍinet_ntoa()


INET_ATON(expr)
¸ø³öÒ»¸ö×÷Ϊ×Ö·û´®µÄÍøÂçµØÖ·µÄµãµØÖ·±íʾ£¬·µ»ØÒ»¸ö´ú±í¸ÃµØÖ·ÊýÖµµÄÕûÊý¡£µØÖ·¿ÉÒÔÊÇ4»ò8±ÈÌصØÖ·¡£
mysql> SELECT INET_ATON('209.207.224.40');
+-----------------------------+
| INET_ATON('209.207.224.40') |
+-----------------------------+
| 3520061480 |
+-------------------- ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ