Error installing mysql

I’ve been installing mysql, I enable the service, and activate it.
Then I go the shell and I open

agunet@agunet:~> mysql -u root

Look that ‘agunet@agunet:~>’ is my prompt.
I enter sql and execute the following comands:

SET PASSWORD FOR ‘’@‘localhost’= PASSWORD(‘mypwd’);
SET PASSWORD FOR ‘’@‘agunet’= PASSWORD(‘mypwd’);

Then I execute:

SET PASSWORD FOR ‘root’@‘localhost’= PASSWORD(‘mypwd’);

And when I was typing to type:

SET PASSWORD FOR ‘root’@‘agunet’= PASSWORD(‘mypwd’);

Something happens and screen went blank

NOW I don’t knwo what to do because IF I try to enter via:

mysql -u root
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)

and when I try toe enter:

mysql -u root -p
Enter password
(And after entering te mysql root’s password:
ERROR 1045 (28000) Access denied for user ‘root’@‘localhost’ (using password: YES)

Any feedback will be welcome

regards

agunet74

You mean the system crashed or similar?

Maybe that password change for root didn’t happen at all or was not written to disk. Try to connect with “mysql -u root -p” and entering an empty password.

If that’s a fresh installation anyway, you could stop mysql, wipe out /var/lib/mysql/, and start mysql again to get back to a fresh installation.

PS: you could also change the root password (and secure the installation in other ways) by running “mysql_secure_installation”.
See also: SDB:MySQL installation - openSUSE Wiki

If this is a completely fresh SQL installation with no databases imported or any data that can be lost, you could just start from scratch;

systemctl stop mysql
rm /var/lib/mysql/*
systemctl start mysql
mysqladmin -u root password coolnewrootpassword

Then you should verify it works with;
mysqladmin -u root -p version

It’ll ask for the coolnewpassword which you entered there.

IT works!!! Thanks a lot !!!