kymbrik
3/28/2020 - 11:55 AM

reset password

CREATE USER 'wheekey'@'1.4.5.6' IDENTIFIED BY 'pass';
GRANT ALL PRIVILEGES ON *.* TO 'wheekey'@'109-252-113-48.nat.spd-mgts.ru';
FLUSH PRIVILEGES;


error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)' — Missing /var/run/mysqld/mysqld.sock



This error occurs due to multiple installations of mysql. Run the command:

ps -A|grep mysql
Kill the process by using:

sudo pkill mysql
and then run command:

ps -A|grep mysqld
Also Kill this process by running:

sudo pkill mysqld
Now you are fully set just run the following commands:

service mysql restart
mysql -u root -p


/////////////////////////////

org.freedesktop.PolicyKit1 was not provided by any .service files
sudo apt install policykit-1


/////////////////////////////////////


https://stackoverflow.com/questions/16556497/how-to-reset-or-change-the-mysql-root-password?answertab=votes#tab-top



107

The only method that worked for me is the one described here (I am running ubuntu 14.04). For the sake of clarity, these are the steps I followed:

sudo vim /etc/mysql/my.cnf
Add the following lines at the end:

[mysqld]

C
sudo service mysql restart

mysql -u root

use mysql

select * from mysql.user where user = 'root'; - Look at the top to determine whether the password column is called password or authentication_string

UPDATE mysql.user set *password_field from above* = PASSWORD('your_new_password') where user = 'root' and host = 'localhost'; - Use the proper password column from above

Example:
UPDATE mysql.user 
set `authentication_string`= PASSWORD('passwd')
, `plugin` = 'mysql_native_password'
where `user` = 'root' and `host` = 'localhost';

Плагин если auth socket, то поменять его надо

FLUSH PRIVILEGES;

exit

sudo vim /etc/mysql/my.cnf

Remove the lines added in step 2 if you want to keep your security standards.

sudo service mysql restart