Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old October 20th, 2002, 01:16 PM
porcupine porcupine is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 porcupine User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
2 problems

Hello guys
Here is the first problem. You may find it trivial, but it is a serious obstacle for me. I make a database, a table in mysql and it goes fine.
Then I try to view my table with PHP. I am pretty sure that I can't connect to the database.
In particular "$db = mysql_connect("localhost", "root", "") or die;" statement doesn't seem to be valid.
Should I use another username, password or both? Are there any suggestions?



Trying to solve the previous problem I face a new one: My new username is not anymore "root", but "root@localhost". This happened during a phonecall assistant by a friend. How did this happen? How can I generally change my username?

If the previous explanation is not clear all I mean is: when I try to access mysql the: "mysql -u root" command is not valid. Instead I get this message: "access denied for user: 'root@localhost' (Using password: NO). What do I have to do to login with just "root"?

Thanks for the cooperation

Reply With Quote
  #2  
Old October 20th, 2002, 04:03 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: 2 problems

Quote:
If the previous explanation is not clear all I mean is: when I try to access mysql the: "mysql -u root" command is not valid. Instead I get this message: "access denied for user: 'root@localhost' (Using password: NO). What do I have to do to login with just "root"?


This is normal. When you try and access from a shell, it will append the @localhost to the name. If you were trying to access from a remote connection, it would append that hostname to the username. Have you set a username for root? If so use 'mysql -uroot -p', then it will prompt for a password...

Reply With Quote
  #3  
Old October 20th, 2002, 10:51 PM
porcupine porcupine is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 porcupine User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: 2 problems

How about the serious one problem?
I repeat it just in case...

I make a database, a table in mysql and it goes fine.
Then I try to view my table with PHP. I am pretty sure that I can't connect to the database.
In particular "$db = mysql_connect("localhost", "root", "") or die;" statement doesn't seem to be valid.
Should I use another username, password or both? Are there any suggestions?

Thanks again

Reply With Quote
  #4  
Old October 20th, 2002, 11:30 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: 2 problems

The problems are related. If you can't connect one way, you won't be able to connect the other way. Have you set a password for root?

Reply With Quote
  #5  
Old January 7th, 2003, 09:53 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: 2 problems

I've got the same problem. My database is established on a web server. My web domain is accessed through the same program, though I do not know if they sit on the same server system.
When I created a database, I first had to create a user. The user name is 'dbm.mydomain.com'. The password was set to 'secret'. Then I made the database. I called it 'test', but the server changed it to 'test_mydomain_com'. I don't know why, but my code always says I cannot connect.
This is how the IT told me to set it up:

...
<?php
mysql_connect("dbm.mydomain.com", "test_mydomain_com", "secret") or die("Cannot make connection.");
?>
...

I am so confused. I tried using "localhost"; I tried reversing the host and user names; I tried truncating each to exclude the domain name. Nothing seems to work, or I am overlooking something.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > 2 problems


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT