brashquido1
asked on
Testing MySQL credentials in a batch file
HI All,
I'm trying to write a batch file for Windows XP to install a PHP/MySQL based web app, but have come to a dead stop when trying to find a method of verifying the MySQL credentials supplied by the user. I've been using this command from the command line ;
mysql dbname --user=dbuser --password=dbpass< \s
If the credentials are all correct, then there is obviously no problem. The problem is if any one, or combination of credentials are incorrect the error returned from MySQL does not enable you to distiguish between an incorrect database name, username or password. Anyone know of anyway I can test database name, username and password seperately for MySQL in a batch file for Windows XP so I can determine exactly which credential(s) is wrong?
I'm trying to write a batch file for Windows XP to install a PHP/MySQL based web app, but have come to a dead stop when trying to find a method of verifying the MySQL credentials supplied by the user. I've been using this command from the command line ;
mysql dbname --user=dbuser --password=dbpass< \s
If the credentials are all correct, then there is obviously no problem. The problem is if any one, or combination of credentials are incorrect the error returned from MySQL does not enable you to distiguish between an incorrect database name, username or password. Anyone know of anyway I can test database name, username and password seperately for MySQL in a batch file for Windows XP so I can determine exactly which credential(s) is wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Good point...
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Incorrect database;
ERROR 1049: Unknown database 'dbname'
Incorrect username OR password;
ERROR 1045: Access denied for user: 'user@localhost' (Using password: YES)