啟動iihero5.1服務以後,進到d:\mysql相關目錄:
Java代碼 d:\mysql-5.1.58-win32\bin>mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.1.58-community MySQL Community Server (GPL) Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL v2 license Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> use mysql Database changed mysql> select user,host,password from user; +------+-----------+----------+ | user | host | password | +------+-----------+----------+ | root | localhost | | | root | 127.0.0.1 | | | | localhost | | +------+-----------+----------+ 3 rows in set (0.00 sec) mysql>
密碼為空白總為不妥,可以按照:http://dev.mysql.com/doc/refman/5.1/en/assigning-passwords.html裡的介紹修改一下root的密碼:
Java代碼 mysql> set PASSWORD=PASSWORD('test123'); Query OK, 0 rows affected (0.00 sec) mysql> set PASSWORD for ''@'localhost' = PASSWORD('test123'); Query OK, 0 rows affected (0.00 sec) mysql> select user,host,password from user; +------+-----------+-------------------------------------------+ | user | host | password | +------+-----------+-------------------------------------------+ | root | localhost | *676243218923905CF94CB52A3C9D3EB30CE8E20D | | root | 127.0.0.1 | | | | localhost | *676243218923905CF94CB52A3C9D3EB30CE8E20D | +------+-----------+-------------------------------------------+ 3 rows in set (0.00 sec)