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

MySQLÖÐÔö¼ÓÐÂÓû§²¢¶ÔÆ丳ÓèÏàӦȨÏ޵İ취

£¨1£©¸ñʽ£ºgrant select on Êý¾Ý¿â.* to Óû§Ãû@µÇ¼Ö÷»ú identified by "ÃÜÂë"
 
£¨2£©Àý1¡¢Ôö¼ÓÒ»¸öÓû§user_1ÃÜÂëΪ123£¬ÈÃËû¿ÉÒÔÔÚÈκÎÖ÷»úÉϵǼ£¬²¢¶ÔËùÓÐÊý¾Ý¿âÓвéѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄȨÏÞ¡£Ê×ÏÈÓÃÒÔrootÓû§Á¬ÈëMySQL£¬È»ºó¼üÈëÒÔÏÂÃüÁ
mysql> grant select,insert,update,delete on *.* to user_1@"%" identified by "123";
 
Àý1Ôö¼ÓµÄÓû§ÊÇÊ®·ÖΣÏյģ¬Èç¹ûÖªµÀÁËuser_1µÄÃÜÂ룬ÄÇôËû¾Í¿ÉÒÔÔÚÍøÉϵÄÈκÎһ̨µçÄÔÉϵǼÄãµÄMySQLÊý¾Ý¿â²¢¶ÔÄãµÄÊý¾ÝΪËùÓûΪÁË£¬½â¾ö°ì·¨¼ûÀý2¡£
 
£¨3£©Àý2¡¢Ôö¼ÓÒ»¸öÓû§user_2ÃÜÂëΪ123£¬ÈôËÓû§Ö»¿ÉÒÔÔÚlocalhostÉϵǼ£¬²¢¿ÉÒÔ¶ÔÊý¾Ý¿âaaa½øÐвéѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄ²Ù×÷£¨localhostÖ¸±¾µØÖ÷»ú£¬¼´MySQLÊý¾Ý¿âËùÔÚµÄÄÇ̨Ö÷»ú£©£¬ÕâÑùÓû§¼´Ê¹ÓÃÖªµÀuser_2µÄÃÜÂ룬ËûÒ²ÎÞ·¨´ÓÍøÉÏÖ±½Ó·ÃÎÊÊý¾Ý¿â£¬Ö»ÄÜͨ¹ý MYSQLÖ÷»úÀ´²Ù×÷aaa¿â¡£
mysql>grant select,insert,update,delete on aaa.* to user_2@localhost identified by "123";
 
£¨4£©ÓÃÐÂÔöµÄÓû§Èç¹ûµÇ¼²»ÁËMySQL£¬ÔڵǼʱÓÃÈçÏÂÃüÁ
       mysql -u user_1 -p -h 192.168.113.50 £¨-hºó¸úµÄÊÇÒªµÇ¼Ö÷»úµÄipµØÖ·£©


Ïà¹ØÎĵµ£º

mysql ³£Óú¯Êý

Ò»¡¢³£ÓÃ×Ö·û´®º¯Êý
1.CONCAT(str1,str2,...)
mysql> ? concat;
mysql> SELECT CONCAT('My', 'S', 'QL');
+-------------------------+
| CONCAT('My', 'S', 'QL') |
+-------------------------+
| MySQL        ......

mysql Íü¼ÇROOTÃÜÂëµÄ¼òµ¥½â¾ö·½°¸

1.Í£µômysqld
  service mysqld stop
2.ÖØÆômysqld£¬Ö¸¶¨²ÎÊý
  service mysqld start --skip-networking --skip-grant-tables
  »òÕß
  /opt/mysql/bin/mysqld_safe --skip-networking --skip-grant-tables &
  /opt/mysql/ÊÇÎÒµÄMYSQL°²×°Â·¾¶
  skip-grant-tables:Á¬½ÓʱÌø¹ýÊ ......

LinuxÏ°²×°MySQLÊý¾Ý¿â¹¥ÂÔ

1.MySQL¼ò½é
   MySQLÊÇÒ»¸ö¹ã·ºÊ¹ÓõĽṹ»¯²éѯÓïÑÔ£¨SQL£©Êý¾Ý¿â·þÎñÆ÷¡£ºÍÆäËûSQL·þÎñÆ÷Ò»Ñù£¬MySQLÌṩÁË·ÃÎʺ͹ÜÀíSQLÊý¾Ý¿âµÄ·½·¨£¬µ«ÊÇ£¬MySQLͬʱҲÌṩÁË´´½¨Êý¾Ý¿â½á¹¹ÒÔ¼°ÔÚÕâЩ½á¹¹ÖÐÌí¼Ó¡¢Ð޸ĺÍɾ³ýÕâЩ½á¹¹µÄ¹¤¾ß¡£
   MySQLÊý¾Ý¿âÏà¹ØµÄÈí¼þ°üÖ÷ÒªÓÐÒÔϼ¸ÖÖ£º
   ......

MYSQL ±¸Íü¼

MySQL client programs:
mysql
The command-line tool for interactively entering SQL statements or executing them from a file in batch mode. See Section 4.5.1, “mysql — The MySQL Command-Line Tool”.
mysqladmin
A client that performs administrative operations, such as crea ......

MySQLµÄ¼¸¸öÖØҪĿ¼½éÉÜ

     MySQL°²×°Íê³Éºó²»ÏóSQL ServerĬÈÏ°²×°ÔÚÒ»¸öĿ¼£¬ËüµÄÊý¾Ý¿âÎļþ¡¢ÅäÖÃÎļþºÍÃüÁîÎļþ·Ö±ðÔÚ²»Í¬µÄĿ¼£¬Á˽âÕâЩĿ¼·Ç³£ÖØÒª£¬ÓÈÆä¶ÔÓÚLinuxµÄ³õѧÕߣ¬ÒòΪ Linux±¾ÉíµÄĿ¼½á¹¹¾Í±È½Ï¸´ÔÓ£¬Èç¹û¸ã²»Çå³þMySQLµÄ°²×°Ä¿Â¼ÄǾÍÎÞ´Ó̸ÆðÉîÈëѧϰ¡£ÏÂÃæ¾Í½éÉÜÒ»ÏÂÕ⼸¸öĿ¼¡£
£¨1£©Êý¾Ý¿âĿ¼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ