| Hmm I guess so everyone thought that I was the troll who just hates X because Y reason!! I did a
sudo -u suraj createdb mydb It said that role suraj didn't exist, then I realized that postgres was using my own username, I didn't touch a single config file! In a remarkable sense of irony, postgres is so amazing that while installation mysql needs us to give a password, postgres uses this user concept and for each database you have to create a new user so there is no one password to rule them all. $ sudo -u suraj psql I was just trying to do $ psql then it was saying that the role suraj didn't exist so I did sudo -u postgres createuser --superuser $USER then it said that role suraj exists, then it said database suraj didn't exist sudo -u suraj createdb amarokdb; then it created the db then I connected the db using the usual format |
If you install Mysql from scratch, you also need to manually set the superuser password.
For a different perspective, read the relevant post-installation configuration documentation for Mysql [0] and Postgresql [1] on Gentoo Linux.
If your distro asks you -as part of the installation process- for a MySQL password, that's a feature that has been added by the MySQL packager for your distro, not a feature of MySQL.
> postgres uses this user concept and for each database you have to create a new user so there is no one password to rule them all.
This is completely incorrect. Look at pg_hba.conf and the comments contained within, as well as the GRANT command I mentioned in an earlier comment.
A suggestion:
Slow down. Block out an hour or two to learn how to properly manage both a Postgres and a MySql server.
Figure out that Postgres calls "Users" "Roles" (because a Role can be one or more users). Read about Database Role management in the official Postgres documentation. Learn about Roles and Role permission management. Do the same for MySQL.
Once you've done this you will
* Be able to manage DB user accounts and permissions without depending on random internet walkthroughs.
* Understand that -despite the terminology differences- managing users and DB permissions is fundamentally the same in MySQL and Postgres.
[0] https://wiki.gentoo.org/wiki/MySQL/Startup_Guide#MySQL_Insta...
[1] https://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Starting_...