Aleks Aleks - 1 month ago 9x
MySQL Question

Mysql on Ubuntu: ERROR 1045 (28000)

I've installed mysql server on my Ubuntu 16.04 using this command:

user@samariter-ubuntu:~/dev$ sudo apt-get install mysql-server

I left the "root" pass blank. It went fine, no objections. However, when I try to start it, it refuses:

user@samariter-ubuntu:~/dev$ mysql
ERROR 1045 (28000): Access denied for user 'sasa'@'localhost' (using password: NO)

I must start it with sudo. Why is that? How can I solve it?


sudo service mysql-server : Install mysql server as a service. It downloads mysql server latest version available from apt repository.

sudo service mysql status : Check the status of your service

sudo service mysql start : start mysql server

sudo service mysql stop : stop mysql server

sudo service mysql restart : restart mysql service

To connect mysql server from mysql built in client, use the below command

$> mysql -u root -p

If your root password is empty, just press enter again. You will be prompted to

mysql >