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

mysqlÍü¼ÇrootÃÜÂëµÄ½â¾ö

mysqlÍü¼ÇrootÃÜÂëµÄ½â¾ö
Ò». MySQLÃÜÂëµÄ»Ö¸´·½·¨Ö®Ò»
Èç¹ûÍü¼ÇÁËMySQLµÄrootÃÜÂ룬¿ÉÒÔÓÃÒÔÏ·½·¨ÖØÐÂÉèÖãº
1. KILLµôϵͳÀïµÄMySQL½ø³Ì£»
killall -TERM mysqld
2. ÓÃÒÔÏÂÃüÁîÆô¶¯MySQL£¬ÒÔ²»¼ì²éȨÏ޵ķ½Ê½Æô¶¯£»
safe_mysqld --skip-grant-tables &
3. È»ºóÓÿÕÃÜÂ뷽ʽʹÓÃrootÓû§µÇ¼ MySQL£»
mysql -u root
4. ÐÞ¸ÄrootÓû§µÄÃÜÂ룻
mysql> update mysql.user set password=PASSWORD('ÐÂÃÜÂë') where User='root';
mysql> flush privileges;
mysql> quit
ÖØÐÂÆô¶¯MySQL£¬¾Í¿ÉÒÔʹÓÃÐÂÃÜÂëµÇ¼ÁË¡£
¶þ. MySQLÃÜÂëµÄ»Ö¸´·½·¨¶þ
ÓпÉÄÜÄãµÄϵͳûÓÐ safe_mysqld ³ÌÐò(±ÈÈçÎÒÏÖÔÚÓÃµÄ ubuntu²Ù×÷ϵͳ, apt-get°²×°µÄmysql) , ÏÂÃæ·½·¨¿ÉÒÔ»Ö¸´
1. Í£Ö¹mysqld£»
  sudo /etc/init.d/mysql stop
(Äú¿ÉÄÜÓÐÆäËüµÄ·½·¨,×Üֹ֮ͣmysqldµÄÔËÐоͿÉÒÔÁË)
2. ÓÃÒÔÏÂÃüÁîÆô¶¯MySQL£¬ÒÔ²»¼ì²éȨÏ޵ķ½Ê½Æô¶¯£»
mysqld --skip-grant-tables &
3. È»ºóÓÿÕÃÜÂ뷽ʽʹÓÃrootÓû§µÇ¼ MySQL£»
mysql -u root
4. ÐÞ¸ÄrootÓû§µÄÃÜÂ룻
mysql> update mysql.user set password=PASSWORD('newpassword') where User='root';
mysql> flush privileges;
mysql> quit
ÖØÐÂÆô¶¯MySQL
/etc/init.d/mysql restart
¾Í¿ÉÒÔʹÓÃÐÂÃÜÂë newpassword µÇ¼ÁË¡£


Ïà¹ØÎĵµ£º

MySQL²é¿´ºÍµ¼Èëµ¼³öÃüÁî

1¡¢ÏÔʾÊý¾Ý¿âÁÐ±í£º
   show databases;
   ¸Õ¿ªÊ¼Ê±²ÅÁ½¸öÊý¾Ý¿â£ºmysqlºÍtest¡£mysql¿âºÜÖØÒªËüÀïÃæÓÐMYSQLµÄϵͳÐÅÏ¢£¬ÎÒÃǸÄÃÜÂëºÍÐÂÔöÓû§£¬Êµ¼ÊÉϾÍÊÇÓÃÕâ¸ö¿â½øÐвÙ×÷¡£
2¡¢ÏÔʾ¿âÖеÄÊý¾Ý±í£º
   use mysql£» //´ò¿ª¿â
   show tables;
3¡¢ÏÔʾÊý¾Ý±íµÄ½á¹¹£ ......

Mysql£¬SqlServer£¬OracleÖ÷¼ü×Ô¶¯Ôö³¤µÄÉèÖÃ


Mysql£¬SqlServer£¬OracleÖ÷¼ü×Ô¶¯Ôö³¤µÄÉèÖÃ
1¡¢°ÑÖ÷¼ü¶¨ÒåΪ×Ô¶¯Ôö³¤±êʶ·ûÀàÐÍ
ÔÚmysqlÖУ¬Èç¹û°Ñ±íµÄÖ÷¼üÉèΪauto_incrementÀàÐÍ£¬Êý¾Ý¿â¾Í»á×Ô¶¯ÎªÖ÷¼ü¸³Öµ¡£ÀýÈ磺
create table customers(id int auto_increment primary key not null, name varchar(15));
insert into customers(name) values("name1"),("nam ......

MYsql ÒìµØ±¸·Ý½Å±¾

ÔÚÒìµØµÄ·þÎñÆ÷±¸·ÝMysqlʱ£¬ÒìµØµÄ·þÎñÆ÷ûÓа²×°MysqlÊý¾Ý¿â£¬±¸·ÝµÄmysqldumpÃüÁîÊDz»ÄÜÉúЧµÄ¡£ËùÒÔ¿ÉÒ԰Ѱ²×°mysqlÊý¾Ý¿âËùÔÚ·þÎñÆ÷ÖеÄmysqldump.exe£¨È磺C:\Program Files\MySQL\MySQL Server 5.0\binĿ¼ÖеÄmysqldump.exe£©¿½±´µ½ÒìµØ·þÎñÆ÷ÖеÄÒ»¸öĿ¼ÖУ¨È磺F:\MySQLBackup£©¡£
 
±ÈÈçÎļþà ......

½â¾öMySQLÂÒÂë

mysql±àÂëӦעÒâµÄ»·½Ú£º
 
Õ⼸¸ö»·½Ú±àÂ붼ͳһÁË£¬Ò»°ã²»»á³öÏÖÂÒÂë¡£BTW:
¿ÉÒÔÓÃSET NAMES xÁÙʱÉèÖÃmysql±àÂ룺
Ï൱ÓÚ
SET character_set_client = x;
SET character_set_results = x;
SET character_set_connection = x;
È磺
mysql_query("SET NAMES 'gb2312'") or die("Query failed : " . mysql_er ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ