MYSQLÍü¼ÇROOTÃÜÂëºó£¿
MYSQLÍü¼ÇROOTÃÜÂëºó£¿
ÐÞ¸ÄMySQLµÄµÇ¼ÉèÖãº
1.È¡ÏûȨÏÞ¹ÜÀí
±à¼ /mysql5.1/my.ini
ÔÚ[mysqld]µÄ¶ÎÖмÓÉÏÒ»¾ä£ºskip-grant-tables
ÀýÈ磺
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-name-resolve
skip-grant-tables
Ä¿µÄÊÇΪÁË£º
Ìø¹ýMySQLµÄ·ÃÎÊ¿ØÖÆ£¬ÈκÎÈ˶¼¿ÉÒÔÔÚ¿ØÖÆ̨ÒÔ¹ÜÀíÔ±µÄÉí·Ý½øÈëMySQLÊý¾Ý¿â¡£
ÐèҪעÒâµÄÊÇÔÚÐÞ¸ÄÍêÃÜÂëÒÔºóÒª°ÑMySQL·þÎñÆ÷Í£µôÖØÐÂÆô¶¯²Å»áÉúЧ
ÖØÆômysql·þÎñ£¡
2.µÇ½ÐÞ¸ÄrootÓû§ÃÜÂë
mysql> USE mysql ;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> UPDATE user SET Password = password ( ‘new-password’ ) WHERE User = ‘root’ ;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 2 Changed: 0 Warnings: 0
mysql> flush privileges ;
Query OK, 0 rows affected (0.01 sec)
mysql> quit
3.Ôö¼ÓȨÏÞ¹ÜÀí
°´ÕÕµÚ1²½·½°¸[mysqld]µÄ¶ÎÖÐɾ³ý£ºskip-grant-tables
PS£º
¿ÉÄܳöÏÖµÄÎÊÌ⣺
1.Host 'localhost' is not allowed to connect to this MySQL server ?
ÓÉÓÚÊDZ¾µØ²âÊÔ£¬¿ÉÓþÍÐУ¬¹Êû½â¾öÕâ¸öÎÊÌ⣡
Ïà¹ØÎĵµ£º
1¡¢ÔÚmysql Êý¾Ý¿âÖУ¬“2009-09-15 00£º00£º00”ת»¯ÎªÁÐΪ³¤ÕûÐ͵ĺ¯Êý£º
select unix_timstamp("2009-09-15 00£º00£º00")*1000,
ÕâÀïҪעÒ⣬mysqlÊý¾Ý¿âÖеij¤ÕûÐÍ£¬±ÈjavaÖеij¤ÕûÐÍÉÙÁËÃëºóÃæµÄºÁÃëÊý£¬ËùÒÔÒª³ËÒÔ1000£¬ÕâÑùÖ»Óм¸ºÁÃëÖ®²î
2¡¢ÔÚmysqlÊý¾Ý¿âÖУ¬“1252999488000”£ ......
Ò»¡¢½¨±í
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`ID` int(11) NOT NULL auto_increment,
`NAME` varchar(16) NOT NULL default '',
`REMARK` varchar(16) NOT NULL default '',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8;
&nb ......
1.´ÓWindowsÃüÁîÐÐÆô¶¯MySQL
ÒªÏë´ÓÃüÁîÐÐÆô¶¯mysqld·þÎñÆ÷£¬ÄúÓ¦µ±Æô¶¯¿ØÖÆ̨´°¿Ú(»ò“DOS window”)²¢ÊäÈëÃüÁ
¡¡¡¡C£º\> C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld
¡¡¡¡¸ù¾ÝϵͳÖÐMySQL°²×°Î»ÖõIJ»Í¬£¬Ç°ÃæµÄÀý×ÓÖÐʹÓõÄ·¾¶Ò²²»Í¬¡£
¡¡¡¡ÔÚ·ÇNT°æ±¾µÄWindowsÖУ¬ÔÚºǫ́Æô¶¯mysqld¡£Ò² ......
character-set-server = GB2312
collation-server = latin1_general_ci
MySQL×Ö·û¼¯ GBK¡¢GB2312¡¢UTF8Çø±ð ½â¾ö MYSQLÖÐÎÄÂÒÂëÎÊÌâ ÊÕ²Ø
MySQLÖÐÉæ¼°µÄ¼¸¸ö×Ö·û¼¯
character-set-server/default-character-set£º·þÎñÆ÷×Ö·û¼¯£¬Ä¬ÈÏÇé¿öÏÂËù²ÉÓõġ£
character-set-database£ºÊý¾Ý¿â×Ö·û¼¯¡£
character-set-table£ºÊ ......
mysql>use mysql;
mysql>update user set host='%' where user='root';
ÖØÆôMysql
sudo /etc/init.d/mysql restart
[sudo] password for wangzw:
*Stopping MySQL database server mysqld & ......