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

³£Óõ½µÄmysqlÃüÁî±Ê¼Ç

mysqlÉèÖÃÃÜÂëºÍÐÞ¸ÄÃÜÂ룺
/usr/local/mysql/bin/mysqladmin -uroot password 123456 µÚÒ»´ÎÉèÃÜÂë¡£
mysqladmin -uroot -p password mypasswd ÐÞ¸ÄÃÜÂë
ÊäÈëÕâ¸öÃüÁîºó£¬ÐèÒªÊäÈërootµÄÔ­ÃÜÂ룬ȻºórootµÄÃÜÂ뽫¸ÄΪmypasswd¡£
¾ÍÊÇmysql5µ¼³öµÄÓÐdefault-charactµÄÉèÖã¬mysql4²»Ö§³Ö£¬ÐèÒª¼Óskip-opt²ÎÊý£¬È磺
mysqldump -uroot -p --default-character-set=gbk -skip-opt databse > hx.sql
Ò»°ãµÄÊý¾Ýµ¼³öÓÃ
mysqldump -uroot -pÃÜÂë database > database.sql //µ¼³öÊý¾Ý¡£
mysqldump -uroot -pÃÜÂë --opt Êý¾ÝÃû ±íÃû > /home/2009_5_29.sql //±¸·ÝÊý¾ÝÖеıí
mysqldump -uroot -pÃÜÂë --databases Êý¾ÝÃû1 Êý¾ÝÃû2 > /home/2009_5_29.sql //±¸·Ý¶¼¸öÊý¾Ý¿â
mysql -u root -p book <book.sql  »òÖ±½Ó source book.sql //ÆäÖÐbookΪÊý¾Ý¿â
drop database Êý¾ÝÃû; //ɾ³ýÊý¾Ý
drop table ±íÃû;  //ɾ³ý±í
ÏÂÃæ¶ÔһЩûÓõÄÓû§É¾³ý£¬
ÏȲ鿴 mysql ĬÈÏÓÐÄÇЩÓû§¡£
 mysql µÄÓû§£¬»¹ÓÐһЩÐÅÏ¢ ÊÇ·ÅÔÚ mysql Êý¾Ý¿âµÄ¡£
mysql> use mysql;
Database changed
mysql> show tables;
¿ÉÒÔ¿´µ½ ÀïÃæµÄ±í¡£¡£¡£ÆäÖÐ user ±í£¬¾ÍÊÇ´æ·ÅÓû§ÐÅÏ¢µÄ±í¡£
> select * from user;  ¿ÉÒԲ鿴ÀïÃæÐÅÏ¢£¬
ÓÉÓÚÐÅϢ̫¶à£¬ÎÒÃÇÑ¡ÔñÆäÖм¸¸öÁÐ
mysql> select Host,User,Password from user;
mysql> delete from user where User='';
Query OK, 2 rows affected (0.01 sec)
Ôٲ鿴һÏ¡£
mysql> select Host,User,Password from user;
¿ÕÓû§ÒѾ­±»É¾³ý
ÈçºÎÌí¼ÓÆäËûÓû§ÎÊÌâ¡£¡£¡£ÉèÖõ½°²È«ÎÊÌâ
1£¬ Ìí¼ÓÒ»¸öÓû§17rumenÃÜÂëÊÇ123 £¬¿ÉÒÔÔÚÈκÎÖ÷»úµÇ½£¬²¢ÇÒ¶ÔËùÓÐÊý¾Ý¿â
    ¿ÉÒÔ½øÐвéѯ£¬²åÈ룬Ð޸ģ¬É¾³ýµÄ²Ù×÷¡£
mysql> grant select,insert,update,delete on *.* to '17rumen'@'%' identified by '123';
Query OK, 0 rows affected (0.00 sec)
ÕâÑùµÄÓû§£¬¾Í¿ÉÒÔÔÚÔ¶³Ì½øÐеǽ£¬Òª¼ÓÈë Ö÷»úµÄipµØÖ·²Å¿ÉÒÔ
]# mysql -h 192.168.1.118 -u17rumen -p123
µÇ½ÉÏÈ¥ÁË
=====
2£¬ Ìí¼ÓÒ»¸öÓû§17rumen2ÃÜÂëÊÇ123£¬Ö»ÄÜÔÚ localhost ±¾»úÉϵǽ¡£
    ²¢ÇÒÖ»ÄÜ¶Ô test Êý¾Ý¿â½øÐÐ ²éѯ£¬²åÈ룬Ð޸ģ¬É¾³ýµÄ²Ù×÷¡£
    ²»ÄܶԱðµÄÊý¾Ý¿â½øÐвÙ×÷£¬Õâ¸öÎÒ¾õµÃ·Ç³£ÖØÒª¡£
mysql> grant select,insert,updat


Ïà¹ØÎĵµ£º

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 ·þÎñÆ÷ÊÇ·ñÕýÔÚÔËÐУº ......

MysqlµÄvarcharÀàÐÍ

×Ô´ÓÈÏʶmysqlµÄÄÇÌìÆð¾ÍÖªµÀvarcharµÄ³¤¶ÈÏÞÖÆΪ255£¬²»¹ýÏÖÔÚÕâÖÖÇé¿öÒѾ­¸Ä±äÁË£º
Values in VARCHAR columns are variable-length strings. The length can be specified as a value from 0 to 65,535. The effective maximum length of a VARCHAR is subject to the maximum row size (65,535 by ......

MySQL Proxy °²×°Óë¶Áд·ÖÀëÌåÑé


Ô­×÷£ºÑîÌÎ(ÉϵÛËû°Ö)
Ò»Ö±ÏëµÈµ½BETA°æ³öÀ´ÔÙÊÔÑéµÄ£¬¿É»¹ÊǾ­²»×¡ÓÕ»ó°¢,ÏÂÎçÖÕÓÚÓÐʱ¼ä²âÊÔÒ»ÏÂÁË¡£
£¨±¾ÎIJο¼µØÖ·£ºhttp://blog.chinaunix.net/u/8111/showart.php?id=451420£©
Ò»¡¢±Ø±¸Èí¼þ£º
1¡¢LUA
   ¿ÉÒÔÈ¥LUAµÄ¹Ù·½ÏÂÔØ£ºwww.lua.org
2¡¢MySQL Proxy
   ÕâÀïÓкöà¶þ½øÖÆ°æ±¾¡£
& ......

Mysql for linux mysql×Ô¶¯±¸·Ý½Å±¾

¿ÉÒÔ½«Õâ¸ö½Å±¾·Å½øcrontab£¬ËûµÄÅäÖÆÎļþÔÚ /etc/crontabÖÐÿÌìÁ賿ִÐÐÒ»´Î£¬×Ô¶¯±¸·Ý Õâ¸ö½Å±¾Ã¿Ìì×î¶àÖ»Ö´ÐÐÒ»´Î£¬¶øÇÒÖ»±£Áô×î½üÎåÌìµÄ±¸·ÝÔÚ·þÎñÆ÷ÉÏ¡£
#!/bin/bash
#This is a ShellScript For Auto DB Backup
#Powered by aspbiz
#2004-09
#Setting
#ÉèÖÃÊý¾Ý¿âÃû£¬Êý¾Ý¿âµÇ¼Ãû£¬ÃÜÂ룬±¸·Ý·¾¶£¬ÈÕ־ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ