There seems to be no space between username and --password
If you donβt know the root password with Debian or Ubuntu, there is an easy way to reset: First, get the exact version of your server using
sudo dpkg --get-selections | grep 'mysql-server-'
Then just use sudo dpkg-reconfigure mysql-server-5.x
(btw, replace 5.x with your real version number)
With a new installation, the root password is empty by default, so it should be able to log in using only
mysql -u root
After installation, add the root password after installation
mysqladmin -u root password [newpassword]
In most cases, before working with the database, you should also configure dedicated accounts with limited rights.
source share