T
T
Timofey2018-06-12 17:35:44
linux
Timofey, 2018-06-12 17:35:44

How to connect to local mysql server without password?

I installed VestaCP along with mysql server.
While picking root privileges, he broke his login without a password using the mysql or mysql -u root command.
Now, when I write one of these commands, I get:
'Access denied for user 'root'@'localhost' (using password: YES)'
There is nothing in the database, except for the settings from the vesta and its standard user database.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
Ruslan Fedoseev, 2018-06-12
@T1MOX4

.my.cnf in the user's home view

S
SagePtr, 2018-06-12
@SagePtr

" (using password: YES)" - means, after all, the password is set when connecting. Try explicitly specifying an empty password.

S
Sanes, 2018-06-12
@Sanes

you can add
skip-grant-tables to my.cnf
this will allow you to connect without a password

A
AVKor, 2018-06-12
@AVKor

Debian (and clones) have a special user, with settings in /etc/mysql/debian.cnf. You can use it to set a password for any user.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question