I am using Ubuntu 19.10 and installed mysql-server on it. First it gave me an error
error was mysql access denied for user 'root'@'localhost'
solved by code below
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
based on an answer here https://stackoverflow.com/questions/41645309/mysql-error-access-denied-for-user-rootlocalhost
I had rebooted the virtual machine now when I try to login
debian@osboxes:~$ mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
I tried following
debian@osboxes:~$ mysql -u root -p 123456
Enter password:
ERROR 1049 (42000): Unknown database '123456'
I want to know what mistake I am doing. I am trying to use mysql for some assignments is the above not the correct way to go to an sql prompt. What else should I do? I am using Ubuntu 19.10.
I don't have any idea of upstart echo system back in those days we used to have init scripts to start and stop daemons so I am browsing internet and it has become quite confusing what to do and what not to do. Like is the mysql service not available these days or what exactly I need to do to make sure after reboot mysql service is running. Which files should I check.
Your command syntax is wrong, this is why it is not working, get rid of the empty space between
-p
and your password.