Jump to content

MySQL Connection failed?


.Juan.

Recommended Posts

Okay, well, I'm trying to create a register using MySQL and PHP. But first I wanted to test out the MySQL connection first before I made the entire register system. Just in case something goes wrong. And something did.

 

I try to connect, but I just get an error saying:

Access denied for user 'gsrpg_memsdb'@'localhost'

 

I don't see what the problem is exactly. I know I got the username, password, and db name correct (not too certain on the location of the mysql server to connect to). I searched the forums and found that the server name to connect to is 'localhost', but if it's not then please say.

 

I've tried 'stevie' and 'stevie.heliohost.org' for the server names as well but they haven't worked.

 

If anyone could shine any light on my situation, I'd be grateful.

 

-Juan

Link to comment
Share on other sites

First of all, localhost is correct.

 

Judging by the text of the error, it seems as though you did not add permissions to your MySQL user. Go to http://stevie.heliohost.org:2082/frontend/x3/sql/index.html

Once there, find the two dropdown boxes to "Add User To Database" (bottom). Select the user and database and click add. Select "All Privileges" and then press Make Changes. That should fix the problem.

Link to comment
Share on other sites

You have to append your username to your database when asked of it. For example, if I had a databased called phpbb, it would actually be wizard_phpbb. The same applies to users.

 

 

You should also double check your php code with a php forum. They most likely know more than we do about php and will be able to help you debug it.

Link to comment
Share on other sites

I know, the name of the db and username has to contain your username. I did that, and it's not going right with me.

 

And the code isn't very long: simply showing the text "Hallo" to see if the connection is okay. I made it like that before I created the entire register system just in case I had an incident in connecting. Coincidentally, I do. D:

Link to comment
Share on other sites

Try making a new user and new database. Be sure to add the permissions. Set the host to localhost and directly copy and paste the username and database name to make sure it is correct. Use a new password. (The password does not contain the username of your account like the db name and username does). See if that connects.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...