phpmyadmin has access my PHP program does not
Posted by: magnets (---.hsd1.ga.comcast.net)
Date: August 13, 2014 12:27AM

I installed wampserver and phpmyadmin provides access to the mysql database. I can populate the database as needed. I use windows 7.

But, I simply can not figure out the username and password to connect via a PHP program to get access to that populated PHP database. I'm using localhost, username, password, database name in my mysqi connect string.

Are there specific instructions I can use within phpmyadmin to type in so that the result is exactly what I need?

I've found so many answers that say this and that about proper setup and tried them all. I have no idea what I might have done wrong. I generally use Linux servers and have used phpmyadmin to setup user names and passwords and Grant privileges.

1. phpmyadmin works
2. phpmyadmin has full access to the data for add, update and deletion
3. my PHP program fails on its connect attempt.

What other information do I need to provide you?

Options: ReplyQuote
Re: phpmyadmin has access my PHP program does not
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: August 13, 2014 12:45AM

All MySQL installs come with a default userid/password


Username = root
Password = blank ( leave this empty )


Of course you could always use phpMyAdmin to create a user/password and then give access to your new database to that user.

If all else fails R.T.F.M

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: phpmyadmin has access my PHP program does not
Posted by: magnets (---.hsd1.ga.comcast.net)
Date: August 13, 2014 02:20AM

1. If 'root' and a blank password would have worked in my php script I would not be asking a question on this forum
2. I already used phpMyAdmin to create a user / password
3. I extended ALL PRIVILEGES to the database to be accessed for that user except GRANT
4. the TYPE says database-specific

Your answer was not an answer to my question. My question was "Are there specific instructions I can use within phpmyadmin to type in so that the result is exactly what I need?"

I think the answer is No, but, since I supposed you were far more of an expect I thought I would ask. And, in a future version of your wonderful wampserver, perhaps you could generate a working example connect include file.

Options: ReplyQuote
Re: phpmyadmin has access my PHP program does not
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: August 13, 2014 11:41AM

Now Now calm down,

The usual answer to a question about cannot connect to mysql is that people do not bother to take a quick look at the MySQL site to find out about the default configuration of the root user account.


Lets start at the beginning - There is a Sticky post called READ THIS BEFORE YOU ASK A QUESTION please do, and if you would not mind answering these questions it will help us in identifying your actual problem.

Then if you were to post your

1. PHP code.

2. The actual error message you are recieving.

3. Anything else that might be useful to someone who is trying to help but is not looking over your shoulder at what you are actually doing.

4. Explain what so that the result is exactly what I need? exactly means?



If you have setup a database and a user account that is allowed access to it then the PHP code to connect to that MySQL database with the mysqli extension with the user and password you have created is :-

$mysqli = new mysqli('127.0.0.1', 'USERID', 'PASSWORD', 'DATABASENAME');

if ($mysqli->connect_error) {
    die('Connect Error (' . $mysqli->connect_errno . ') '
            . $mysqli->connect_error);
}


If that is basically what you have done then please supply the above requested info.






PS:
This site prime function is to help people get WAMPServer ( thats Apache/MySQL/PHP ) running.
It is not I am afraid a PHP prgramming tutorial site.
But we aim to help where we can.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.