I installed Trixbox onto my Dell machine. I wanted to write an application to access database acoompanied trixbox. This was MySql based. I opened ssh session to the machine, logged-in and tried to open MySql prompt and I got the following error:
[trixbox1.localdomain ~]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user ‘root’@'localhost’ (using password: YES)
I searched net and finally came to solution this way:
[trixbox1.localdomain ~]# /etc/init.d/mysqld stop
Stopping MySQL: [ OK ]
[trixbox1.localdomain ~]# mysqld_safe –skip-grant-tables &
Starting mysqld daemon with databases from /var/lib/mysql
[trixbox1.localdomain ~]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.22
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql> UPDATE mysql.user SET password=”" WHERE User=’root’ AND Host=’localhost’;
Query OK, 1 row affected (0.02 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> quit
Bye
[trixbox1.localdomain ~]# ps xf | grep mysql
4257 pts/0 T 0:00 \_ /bin/sh /usr/bin/mysqld_safe –skip-grant-tables
4663 pts/0 S+ 0:00 \_ grep mysql
4609 pts/0 S 0:00 /bin/sh /usr/bin/mysqld_safe –defaults-file=/etc/my.cnf –pid-file=/var/run/mysqld/mysqld.pid –log-error=/var/log/mysqld.log
[trixbox1.localdomain ~]# kill -9 4257
[trixbox1.localdomain ~]# kill -9 4609
[1]+ Killed mysqld_safe –skip-grant-tables
[trixbox1.localdomain ~]# /etc/init.d/mysqld start
Starting MySQL: [ OK ]
[trixbox1.localdomain ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.22
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql> quit
Bye
I hope, this solves your problem too.
Posted by Chirag
Posted by Chirag