Reputation: 103
Somehow I wanted to install MySQL manually, so I did as explained in How to Set Up MySQL on Google Compute Engine except that I didn't need to create a VM instance because I already have one.
That is, since my OS is 'Debian GNU/Linux 9 (stretch)', I executed the following two commands to install MySQL:
$ sudo apt-get update
and
$ sudo apt-get -y install mysql-server
There's no errors in this step and I created a root password by the following command:
$ sudo mysql_secure_installation
But when I tried to connect to MySQL, (entering the root password I created)
$ mysql --user=root --password
I've got
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
What would be a problem here and what should I check in order to connect to MySQL?
Upvotes: 1
Views: 497
Reputation: 485
There is an error on the tutorial. In order to connect to the MySQL you should run:
$ sudo mysql --user=root --password
Upvotes: 2