Page 1 of 1

Password clarification - config.inc.php

PostPosted: 18. August 2013 20:08
by waveform
Hello,

I understand that the passwords are stored in the database in a user table. But when I first log into MySQL from the command line, I have not created a database at that stage, so what database am I actually logging into? All these help pages I've run across talk about logging into MySQL which makes it sound as though your logging in to the MySQL client itself but not actually logging into any specific database with that initial user and password.


One last question please.
I don't think understand the password section of the config.inc file as far as what I read in the phpmyadmin help section on passwords.

When I set my root password, It's my understanding that I had to also set it in the:
Config.inc.php file under the section titled: Authentication type and info.

But what is the function of setting the password in the config.inc.php file? If you've already set it using the command in the shell, what does the password in the config.inc.php really do?
Also, I thought the shell automatically updated the config.inc.php file if you use the security section? It did not for me.

I "did" set my root password, it works because I've tested logging in with the new password, but my config.inc.php section still has nothing between the two quotation marks in the code above: ' '
I know I can change this in notepad, but what is it doing that the shell command is not?

In a page I was reading, the author showed two different syntax commands to use, but never said why you have to use two, or what they are?
Code: Select all
    mysqladmin -u root password “newpassword”
    mysqladmin -u root -h host_name password “newpassword”

Re: Password clarification - config.inc.php

PostPosted: 18. August 2013 21:47
by Altrea
Hi waveform,

waveform wrote:I understand that the passwords are stored in the database in a user table. But when I first log into MySQL from the command line, I have not created a database at that stage, so what database am I actually logging into? All these help pages I've run across talk about logging into MySQL which makes it sound as though your logging in to the MySQL client itself but not actually logging into any specific database with that initial user and password.

If you don't specify a database name in your mysql cli connect command you don't connect to any database.
MySQL is a RDMS (relational database management system) so you must be able to manage/administrate databases without logging to a specific one.
A host-user-password combination can be restricted to a database, but don't have to.

waveform wrote:I don't think understand the password section of the config.inc file as far as what I read in the phpmyadmin help section on passwords.

When I set my root password, It's my understanding that I had to also set it in the:
Config.inc.php file under the section titled: Authentication type and info.

But what is the function of setting the password in the config.inc.php file? If you've already set it using the command in the shell, what does the password in the config.inc.php really do?

Also, I thought the shell automatically updated the config.inc.php file if you use the security section? It did not for me.

MySQL is completely independend from phpMyAdmin. phpMyAdmin is just a third party gui for MySQL databases.
If you change your root password there are several ways to use it in phpmyadmin. One way is to store it in the configuration file and use that to login (auth type config). Other possibilities are to show a login form (Auth type cookie or http).

waveform wrote:In a page I was reading, the author showed two different syntax commands to use, but never said why you have to use two, or what they are?
Code: Select all
    mysqladmin -u root password “newpassword”
    mysqladmin -u root -h host_name password “newpassword”

The only difference is the host parameter. So what do you think is the host parameter for?

best wishes,
Altrea

Re: Password clarification - config.inc.php

PostPosted: 25. August 2013 17:13
by waveform
Hello altrea
Thank you for clarifying the config.inc file usage!

If I may just make sure I'm clear on the passwords points:
So the MySQL password is only used for accessing the database server application (MySQL) in this case?
In other words if I have a public web site, and my hosting company has MySQL implemented, the password at that stage is only to access their MySQL software? So the database files are usually never locked?
So if your DB is on a public sever with a hosting company, All the user db permissions are being applied to the hosting company's SQL software/Implementation? And not database independent?

Re: Password clarification - config.inc.php

PostPosted: 26. August 2013 08:20
by Altrea
Hi waveform,

waveform wrote:So the MySQL password is only used for accessing the database server application (MySQL) in this case?

The domain-username-password combination is used to authenticate against the MySQL management system.
This channel it uses can be the MySQL command line interface (CLI) or another client based program, phpmyadmin or another webapplication based GUI, or another third party client program.

waveform wrote:In other words if I have a public web site, and my hosting company has MySQL implemented, the password at that stage is only to access their MySQL software?

Not only accessing the database. A user can have for example global administrative permissions or table manipulating permissions. So a user with the specific permission can also do the specified action on the database.

waveform wrote:So the database files are usually never locked?

What does "locked" mean? Well on filesystem area this files are not protected, yes. But depending on the database engine the data found in the database files are human readable or not human readable.

waveform wrote:So if your DB is on a public sever with a hosting company, All the user db permissions are being applied to the hosting company's SQL software/Implementation? And not database independent?

All users are dependend on the specific MySQL implementation. So that are not any global users which can connect to any MySQL database on the world. Related to the specific Database Management system the user priviledges can be database independend, but don't have to.

best wishes,
Altrea