First, I create a database directory:
$ mysql_install_db --datadir=./foo
Then, I start mysql daemon:
$ mysqld --port=5555 --datadir=./foo &
It starts fine and I can connect to it using, for example, Navicat. I'm trying to connect from shell:
$ mysql --user=root --port=5555 --password= ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
What to do? I also tried to change password first for root user:
$ mysqladmin -u root -P 5555 password foo mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: NO)'
Again, connection works perfectly fine from a standalone SQL application, like Navicat.