Just installed mysql on latest Ubuntu and i want to access /var/lib/mysql directory
It seems there are permissions set for this user :mysql - MySQL Server
but i do not have the password for it.
What can I do to access that directory ?
If you check /etc/passwd, the shell is probably set to /bin/false. This account is usually not meant to be logged into, quite unlike Postgres. It exists to separate the privileges of the mysql database from those of other users on the system.
You don't know why you want to go in there, for normal mysql operations, this seldom needs to be done and there is probably a better way to do what you're wanting to do.
However, if you truly do need access to this directory, sudo to root and make your changes, making sure to chown anything to the mysql user when you are done.
If you are going to be accessing the directory directly often, you could add the mysql group to your user. Most of the time you will not need to do much directly in the directory so it is usually easier to use sudo to modify what you need. Lastly, if you just want to view the items in the directory you could change the permissions on the directory everyone read permissions although I would not recommend changing them unless you really have to.
If you check /etc/passwd, the shell is probably set to /bin/false. This account is usually not meant to be logged into, quite unlike Postgres. It exists to separate the privileges of the mysql database from those of other users on the system.
You don't know why you want to go in there, for normal mysql operations, this seldom needs to be done and there is probably a better way to do what you're wanting to do.
However, if you truly do need access to this directory, sudo to root and make your changes, making sure to chown anything to the mysql user when you are done.
If you are going to be accessing the directory directly often, you could add the mysql group to your user. Most of the time you will not need to do much directly in the directory so it is usually easier to use sudo to modify what you need. Lastly, if you just want to view the items in the directory you could change the permissions on the directory everyone read permissions although I would not recommend changing them unless you really have to.