错误日志
[root@gaosheng ~]# mysqlcheck arcerdb t1; mysqlcheck: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) when trying to connect [root@gaosheng ~]# mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
解决方案:
[root@gaosheng ~]# mysql -uroot -parcerzhang Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 8 Server version: 5.0.77-log Source distribution Type 'help;' or 'h' for help. Type 'c' to clear the buffer. 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> set passwrod for 'root'@'localhost' = password(''); ERROR 1193 (HY000): Unknown system variable 'passwrod' mysql> set password for 'root'@'localhost' = password(''); Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> exit Bye [root@gaosheng ~]# mysqlcheck arcerdb t1; arcerdb.t1 OK [root@gaosheng ~]#