MYSQL³£ÓÃÃüÁ
1¡¢µÇ½MySQL:
mysql -u root -p
2¡¢²é¿´Óû§ÐÅÏ¢
select user,host,password from mysql.user;
select user,host from mysql.user;
3¡¢ÉèÖÃÃÜÂë
set password for root@localhost=password('
ÔÚÕâÀïÌîÈërootÃÜÂë
');
4¡¢ÐÞ¸ÄÃÜÂë
·½·¨1£ºmysqladmin -u root -p password newpassword
·½·¨2£º ££mysql -u root -p mysql
mysql>UPDATE user SET password=PASSWORD("new") WHERE user='root';
mysql>flush privileges;
5
¡¢É¾³ýÄäÃûÓû§
delete from mysql.user where user='';
6
¡¢²é¿´ÏµÍ³ÒÑ´æÔÚµÄÊý¾Ý¿â
show databases;
7¡¢É¾³ýÃûΪtestµÄ¿ÕÊý¾Ý¿â
drop database test;
8¡¢½¨Á¢mysqlÓû§
Àýa:
½¨Á¢¶ÔtestÊý¾Ý¿âÓÐÍêÈ«²Ù×÷ȨÏÞµÄÃûΪcentospubµÄÓû§
mysql>grant all privileges on test.* to centospub@localhost identified by 'password';
Àýb:
Ôö¼ÓÒ»¸öÓû§test1ÃÜÂëΪabc£¬ÈÃËû¿ÉÒÔÔÚÈκÎÖ÷»úÉϵǼ£¬²¢¶ÔËùÓÐÊý¾Ý¿âÓвéѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄȨÏÞ¡£Ê×ÏÈÓÃÒÔrootÓû§Á¬ÈëMYSQL£¬È»ºó¼üÈëÒÔÏÂÃüÁ
mysql>grant select,insert,update,delete on *.* to test1@"%" Identified by "abc";
µ«ÀýbÔö¼ÓµÄÓû§ÊÇÊ®·ÖΣÏյģ¬ÄãÏëÈçij¸öÈËÖªµÀtest1µÄÃÜÂ룬ÄÇôËû¾Í¿ÉÒÔÔÚinternetÉϵÄÈκÎһ̨µçÄÔÉϵǼÄãµÄmysqlÊý¾Ý¿â²¢¶ÔÄãµÄÊý¾Ý¿ÉÒÔΪËùÓûΪÁË¡£
Àýc:
Ôö¼ÓÒ»¸öÓû§test2ÃÜÂëΪabc,ÈÃËûÖ»¿ÉÒÔÔÚlocalhostÉϵǼ£¬²¢¿ÉÒÔ¶ÔÊý¾Ý¿âmydb½øÐвéѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄ²Ù×÷£¨localhostÖ¸±¾µØÖ÷»ú£¬¼´MYSQLÊý¾Ý¿âËùÔÚµÄÄÇ̨Ö÷»ú£©£¬ÕâÑùÓû§¼´Ê¹ÓÃÖªµÀtest2µÄÃÜÂ룬ËûÒ²ÎÞ·¨´ÓinternetÉÏÖ±½Ó·ÃÎÊÊý¾Ý¿â£¬Ö»ÄÜͨ¹ýMYSQLÖ÷»úÉϵÄwebÒ³À´·ÃÎÊÁË¡£
mysql>grant select,insert,update,delete on mydb.* to test2@localhost identified by "abc";
9¡¢²éÕÒ
È·ÈÏcentospubÓû§µÄ´æÔÚÓë·ñ
select user from mysql.user where user='centospub';
10¡¢
½¨Á¢ÃûΪtestµÄÊý¾Ý¿â
create database test;
11
¡¢È¡ÏûcentospubÓû§¶ÔÊý¾Ý¿âµÄ²Ù×÷ȨÏÞ
revoke all privileges on *.* from centospub@localhost;
12
¡¢É¾³ýcentospubÓû§
delete from mysql.user w
Ïà¹ØÎĵµ£º
MySQL³£ÓòÙ×÷»ù±¾²Ù×÷£¬ÒÔ϶¼ÊÇMySQL5.0ϲâÊÔͨ¹ýÊ×ÏÈ˵Ã÷Ï£¬¼ÇסÔÚÿ¸öÃüÁî½áÊøʱ¼ÓÉÏ£»£¨·ÖºÅ£©
1.µ¼³öÕû¸öÊý¾Ý¿â
mysqldump -u Óû§Ãû -p --default-character-set=latin1 Êý¾Ý¿âÃû > µ¼³öµÄÎļþÃû(Êý¾Ý¿âĬÈϱàÂëÊÇlatin1)
mysqldump -u wcnc -p smgp_apps_wcnc > wcnc.sql
2.µ¼³öÒ»¸ö±í
mysqldump -u Ó ......
ÎÒÒ»Ö±ÊÇʹÓÃmysqlÕâ¸öÊý¾Ý¿âÈí¼þ£¬Ëü¹¤×÷±È½ÏÎȶ¨£¬Ð§ÂÊÒ²ºÜ¸ß¡£ÔÚÓöµ½ÑÏÖØÐÔÄÜÎÊÌâʱ£¬Ò»°ã¶¼ÓÐÕâô¼¸ÖÖ¿ÉÄÜ£º
1¡¢Ë÷ÒýûÓн¨ºÃ£»
2¡¢sqlд·¨¹ýÓÚ¸´ÔÓ£»
3¡¢ÅäÖôíÎó£»
4¡¢»úÆ÷ʵÔÚ¸ººÉ²»ÁË£»
1¡¢Ë÷ÒýûÓн¨ºÃ
Èç¹û¿´µ½mysqlÏûºÄµÄcpuºÜ´ó£¬¿ÉÒÔÓÃmysqlµÄclient¹¤¾ßÀ´¼ì²é¡£
ÔÚlinuxÏÂÖ´ÐÐ
/usr/local/mysql/bin/ ......
¿ÉÒÔ£¬µ«ÊÇÍêÈ«»Ö¸´ËùÓÐµÄ±í²»Ò»¶¨¿ÉÒÔ
¹¤¾ß: innodb-recovery
Official Website: http://code.google.com/p/innodb-tools/
This set of tools could be used to check InnoDB
tablespaces and to recover data from damaged tablespaces or from
dropped/truncated InnoDB tables.
Õâ¸ö¹¤¾ßÓÃÀ´¼ì²éInnoDB¿Õ¼ä±íºÍ» ......
½ñÌ죬ҪÓÃexplain²é¿´mysqlµÄÖ´Ðй滮£¬µ«ÊǺÍPostgreSQL²»Í¬µÄÊÇ£¬Ö±½ÓÔÚmysqlÀïÃæÖ´ÐеĽá¹û¿É¶ÁÐÔ²»ÊǺܺã¬ÉÏÍøËÑÁËһȦ£¬·¢ÏÖÁËÒ»¸ö¹¤¾ßmaatkit£¬¿ÉÒÔ½²explainµÄ½á¹ûת»¯ÎªÊ÷×´½á¹¹²é¿´£¬ºÇºÇ£¬·½±ãÁ˺ܶà
°²×°°ì·¨£º
1. sudo yum install mysql
2. sudo yum install mysql-server
3. wget http://maatkit.googl ......