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

½â¾öMySQL²»ÔÊÐí´ÓÔ¶³Ì·ÃÎʵķ½·¨

½â¾ö·½·¨£º
1¡£ ¸Ä±í·¨¡£
¿ÉÄÜÊÇÄãµÄÕʺŲ»ÔÊÐí´ÓÔ¶³ÌµÇ½£¬Ö»ÄÜÔÚlocalhost¡£Õâ¸öʱºòÖ»ÒªÔÚlocalhostµÄÄÇ̨µçÄÔ£¬µÇÈëmysqlºó£¬¸ü¸Ä "mysql" Êý¾Ý¿âÀïµÄ "user" ±íÀïµÄ "host" Ï´Ó"localhost"¸Ä³Æ"%"
mysql -u root -p vmware mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>select host, user from user;
2. ÊÚȨ·¨¡£
ÀýÈ磬ÄãÏëmyuserʹÓÃmypassword´ÓÈκÎÖ÷»úÁ¬½Óµ½mysql·þÎñÆ÷µÄ»°¡£
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
FLUSH   PRIVILEGES;
Èç¹ûÄãÏëÔÊÐíÓû§myuser´ÓipΪ192.168.1.6µÄÖ÷»úÁ¬½Óµ½mysql·þÎñÆ÷£¬²¢Ê¹ÓÃmypassword×÷ΪÃÜÂë
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
FLUSH   PRIVILEGES;
Èç¹ûÄãÏëÔÊÐíÓû§myuser´ÓipΪ192.168.1.6µÄÖ÷»úÁ¬½Óµ½mysql·þÎñÆ÷µÄdkÊý¾Ý¿â£¬²¢Ê¹ÓÃmypassword×÷ΪÃÜÂë
GRANT ALL PRIVILEGES ON dk.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
FLUSH   PRIVILEGES;
ÎÒÓõĵÚÒ»¸ö·½·¨,¸Õ¿ªÊ¼·¢ÏÖ²»ÐÐ,ÔÚÍøÉϲéÁËÒ»ÏÂ,ÉÙÖ´ÐÐÒ»¸öÓï¾ä mysql>FLUSH RIVILEGES ʹÐÞ¸ÄÉúЧ.¾Í¿ÉÒÔÁË
ÁíÍâÒ»ÖÖ·½·¨,²»¹ýÎÒûÓÐÇ××ÔÊÔ¹ýµÄ,ÔÚcsdn.netÉÏÕÒµÄ,¿ÉÒÔ¿´Ò»ÏÂ.
ÔÚ°²×°mysqlµÄ»úÆ÷ÉÏÔËÐУº
1¡¢d:\mysql\bin\>mysql   -h   localhost   -u   root  //ÕâÑùÓ¦¸Ã¿ÉÒÔ½øÈëMySQL·þÎñÆ÷
2¡¢mysql>GRANT   ALL   PRIVILEGES   ON   *.*   TO   'root'@'%'   WITH   GRANT   OPTION  //¸³ÓèÈκÎÖ÷»ú·ÃÎÊÊý¾ÝµÄȨÏÞ
3¡¢mysql>FLUSH   PRIVILEGES  //ÐÞ¸ÄÉúЧ
4¡¢mysql>EXIT  //Í˳öMySQL·þÎñÆ÷
ÕâÑù¾Í¿ÉÒÔÔÚÆäËüÈκεÄÖ÷»úÉÏÒÔrootÉí·ÝµÇ¼À²£¡


Ïà¹ØÎĵµ£º

MysqlÖд´½¨Óû§ÕÊ»§µÄ·½·¨

1.CREATE USER
CREATE USER user [IDENTIFIED BY [PASSWORD] 'password']
    [, user [IDENTIFIED BY [PASSWORD] 'password']] ...
CREATE USERÓÃÓÚ´´½¨ÐµÄMySQLÕË»§¡£ÒªÊ¹ÓÃCREATE USER£¬Äú±ØÐëÓµÓÐmysqlÊý¾Ý¿âµÄÈ«¾ÖCREATE USERȨÏÞ£¬»òÓµÓÐINSERTȨÏÞ¡£¶ÔÓÚÿ¸öÕË»§£¬CREATE USER»áÔÚûÓÐȨÏÞµÄmysq ......

MySQL ÆÕͨË÷Òý¡¢Î¨Ò»Ë÷ÒýºÍÖ÷Ë÷Òý

1¡¢ÆÕͨË÷Òý
¡¡¡¡ÆÕͨË÷Òý£¨Óɹؼü×ÖKEY»òINDEX¶¨ÒåµÄË÷Òý£©µÄΨһÈÎÎñÊǼӿì¶ÔÊý¾ÝµÄ·ÃÎÊËٶȡ£Òò´Ë£¬Ó¦¸ÃֻΪÄÇЩ×î¾­³£³öÏÖÔÚ²éѯÌõ¼þ£¨WHEREcolumn=£©»òÅÅÐòÌõ¼þ£¨ORDERBYcolumn£©ÖеÄÊý¾ÝÁд´½¨Ë÷Òý¡£Ö»ÒªÓпÉÄÜ£¬¾ÍÓ¦¸ÃÑ¡ÔñÒ»¸öÊý¾Ý×îÕûÆë¡¢×î½ô´ÕµÄÊý¾ÝÁУ¨ÈçÒ»¸öÕûÊýÀàÐ͵ÄÊý¾ÝÁУ©À´´´½¨Ë÷Òý¡£
¡¡¡¡2¡¢Î¨Ò»Ë÷Òý ......

MySQLÊý¾Ý¿âµÄdb.optÎļþ


MySQLµÄÿ¸öÊý¾Ý¿âĿ¼ÖÐÓÐÒ»¸öÎļþdb.opt,¸ÃÎļþÖ÷Òª ÓÃÀ´´æ´¢µ±Ç°Êý¾Ý¿âµÄĬÈÏ×Ö·û¼¯ºÍ×Ö·ûУÑé¹æÔò¡£
eg.default-character-set=latin1
default-collation=latin1_swedish_ci
¸ÃÎļþÖд洢µÄÊÇ´´½¨Êý¾Ý¿âʱĬÈϵÄ×Ö·û¼¯ºÍ×Ö·û¼¯Ð£Ñé¹æÔò£¬Ôò¸ÃÊý¾Ý¿âÔÚÒÔºó´´½¨±íʱÈç¹ûûÓÐÖ¸¶¨×Ö·û¼¯ºÍУÑé¹æÔò£¬Ôò¸Ã±íµÄÕâÁ½¸ö ......

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 Ìí¼ÓÓû§µÄÃüÁî

Ò»¡¢´´½¨Óû§µÄÃüÁî
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 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ