MySQL error 2003µÄ½â¾ö¹ý³Ì
MySQL error 2003µÄ½â¾ö¹ý³Ì¸Õ²ÅÂÛ̳³öÏÖ:
error 2003:Can't connect to MySQL server on ..............
ÎÊÌâ:MYSQLÊý¾Ý¿âûÓÐÆô¶¯~
½â¾ö:°Ù¶ÈÁËÒ»ÏÂ,˵µÄ½â¾ö·½·¨¸÷ÖÖ¸÷Ñù,ºÜ¶à.
1\ÔÚ“ÔËÐДÀïÕÒµ½C:\mysql\bin\mysqld-opt.exe ÔËÐоÍÊÇÁË£¡ÕÒÁË,ûÓÐÕâ¸ö¶«Î÷:(
2 ÔÚDosÏ cd \mysql\bin #°´×°ÅÌ·ûÏ mysqld-nt --install #Æô¶¯Mysql mysql #ÔËÐÐMysql ¿ÉÊǽø²»ÁË,Ò»½ø´ËĿ¼DOSÒ³ÃæÒ»ÉÁ¾ÍÏûʧ.
3\¿ªÊ¼-¹ÜÀí¹¤¾ß--·þÎñÀïÕÒMYSQL,Æô¶¯.È»ºóÖØÆð»úÆ÷. °´´Ë°ì·¨,ÕÒµ½MYSQL,Ëü״̬ÄÇÀï±¾À´¾ÍÏÔʾÓиö"Æô¶¯"µÄ:( ±§×ÅÊÔÒ»ÊÔµÄÏë·¨,µãÁËÏÂËû,×ó±ß³öÏÖÆô¶¯¸Ä·þÎñ,ÔÝÍ£¸Ã·þÎñÕâЩ~ µãÁËÒ»ÏÂ"Æô¶¯",Õâʱ,·¢ÏÖ×ó±ßµÄÁбíÖеÄMYSQLÔÀ´µÄÄǸö"Æô¶¯"Ç°,¶àÁ˸ö"ÒÑÆô¶¯". ÐÄÍ·Ò»¶¯,¸Ï½ô»ØÀ´Ë¢ÐÂÂÛ̳,ºÃÁË. ºÇºÇ,¾ÍÕâÑù. ûÓнøÐкóÒ»²½ÖØÐÂÆô¶¯»úÆ÷.
Ïà¹ØÎĵµ£º
ÏÂÃæÏÈÀ´¿´¿´Àý×Ó£º
table
id name
1 a
2 b
3 c
4 c
5 b
¿â½á¹¹´ó¸ÅÕâÑù£¬ÕâÖ»ÊÇÒ»¸ö¼òµ¥µÄÀý×Ó£¬Êµ¼ÊÇé¿ö»á¸´Ôӵöࡣ
±ÈÈçÎÒÏëÓÃÒ»ÌõÓï¾ä²éѯµÃµ½name²»Öظ´µÄËùÓÐÊý¾Ý£¬ÄǾͱØÐëʹÓÃdistinctÈ¥µô¶àÓàµÄÖظ´¼Ç¼ ......
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%
//Á¬½ÓÊý¾Ý¿â
try
{
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
Connection connection= java.sql.DriverManager.getConnection("jdbc:mysql://localhost/dangyuan","root", ......
use mysql
update user set Password=password('newpassword') where User='root';
flush privileges;
Ê×ÏÈÒªÉùÃ÷Ò»µã£¬´ó²¿·ÖÇé¿öÏ£¬ÐÞ¸ÄMySQLÊÇÐèÒªÓÐmysqlÀïµÄrootȨÏ޵ģ¬
ËùÒÔÒ»°ãÓû§ÎÞ·¨¸ü¸ÄÃÜÂ룬³ý·ÇÇëÇó¹ÜÀíÔ±¡£
·½·¨Ò»
ʹÓÃphpmyadmin£¬ÕâÊÇ×î¼òµ¥µÄÁË£¬ÐÞ¸Ämysql¿âµ ......
¶ÔÓÚÿ¸öÀàÐÍÓµÓеÄÖµ·¶Î§ÒÔ¼°²¢ÇÒÖ¸¶¨ÈÕÆÚºÎʱ¼äÖµµÄÓÐЧ¸ñʽµÄÃèÊö¼û7.3.6 ÈÕÆÚºÍʱ¼äÀàÐÍ¡£
ÕâÀïÊÇÒ»¸öʹÓÃÈÕÆÚº¯ÊýµÄÀý×Ó¡£ÏÂÃæµÄ²éѯѡÔñÁËËùÓмǼ£¬Æädate_colµÄÖµÊÇÔÚ×îºó30ÌìÒÔÄÚ£º
mysql> SELECT something from table
WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) select DAYOFWEEK('1998-02-03');
-&g ......
mysqlÍ£Ö¹ÃüÁî
bin/mysqladmin -uroot -p shutdown
mysqlÆô¶¯ÃüÁî
bin/mysqld_safe &
mysql ÐÞ¸ÄrootÃÜÂë
1.Í£Ö¹mysql·þÎñ
2.Æô¶¯mysql·þÎñʱ¸½¼Ó²ÎÊý
mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
3.ÒÔroot½øÈëmysql
mysql -u root mysql
4.Ö´ÐÐsqlÓï¾ä
mysql> UPDATE user S ......