sockets - Resetting MySQL password & missing mysqld.sock file -
i trying run local mysql server, on own computer. have lost password set up. when try connect mysql, following error:
error 2002 (hy000): can't connect local mysql server through socket '/var/run/mysqld/mysqld.sock' (2)
i have therefore tried these steps reset mysql password, line
mysql -u root mysql
returns same error message:
error 2002 (hy000): can't connect local mysql server through socket '/var/run/mysqld/mysqld.sock' (2)
when running command
mysqladmin -u root -p status following message: error: 'can't connect local mysql server through socket '/var/run/mysqld/mysqld.sock' (2)'
check mysqld running , socket: '/var/run/mysqld/mysqld.sock' exists!
i have been checking , file mentioned (/var/run/mysqld/mysqld.sock) doesn't exist. not sure causing this.
i have tried couple of solutions online including this, this, this , this none of solutions worked me. add mysql-server installed on machine.
any appreciated. please accept apologies if there confusion above statements. tried explain happening as can, beginner , clueless happenening there.
1) stop mysql demon process using command :
sudo /etc/init.d/mysql stop
2) start mysqld demon process using --skip-grant-tables option command
sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &
because not checking user privs @ point, it's safest disable networking. in dapper, /usr/bin/mysqld... did not work. however, mysqld --skip-grant-tables did.
1) start mysql client process using command
mysql -u root
2) mysql prompt execute command able change password
flush privileges;
3) reset/update password
set password root@'localhost' = password('password');
4) if have mysql root account can connect everywhere, should do:
update mysql.user set password=password('newpwd') user='root';
once have received message indicating successful query (one or more rows affected), flush privileges:
flush privileges;
then stop mysqld process , relaunch classical way:
sudo /etc/init.d/mysql stop sudo /etc/init.d/mysql start
this borrowed https://help.ubuntu.com/community/mysqlpasswordreset , can check method reset mysql password.
Comments
Post a Comment