![]() |
|
#1
|
|||
|
|||
|
If so, I'd like your help on an issue I'm having.
I installed PHP 4.3.3 along with MySQL 4.1 and Apache 2. I followed the installation instructions to the letter that were in my book (Sams "Teach Yourself PHP, MySQL, and Apache," though it probably doesn't help you to know that). I'm sure that I have them up and running, but when I try to connect to MySQL I get the darn message Quote:
I know someone might have some idea as to what I can do. Besides throwing it all out the window or getting a new book that is....
|
|
#2
|
|||
|
|||
|
to be honest i havent got a clue
i have installed php and mysql and apache but it was a combined and ready to go install package. they only thing i can say is have you created a username and password? there is a tool in one of the folders to set this info up but i cant remember what it was called |
|
#3
|
|||
|
|||
|
Yup, done that. And I'm sure I'm puting in that exact user name and password when I try to connect.
|
|
#4
|
||||
|
||||
|
Could you either post your PHP code or pm me your php code so that I can have a look and make sure your syntax is all ok.
Doesn't matter about including your username and password, just replace then with the words username and password if you wish. The only other thing I can think of is, have you tried using the ip 127.0.0.1 as the ip address of the mysql server? Jeffers
__________________
Wondering what ever happend to QA and where this Out Now, Patch Later culture came from!!!! |
|
#5
|
|||
|
|||
|
Quote:
|
|
#6
|
||||
|
||||
|
Well to me that seems ok.
I'll test the code using my own setup and make sure. To put in the ip address, simple replace localhost with 127.0.0.1 so your code would look like the following: PHP Code:
__________________
Wondering what ever happend to QA and where this Out Now, Patch Later culture came from!!!! |
|
#7
|
|||
|
|||
|
That didn't work either.
|
|
#8
|
||||
|
||||
|
well my mySQL and Apache servers have messed up because I've changed the configurations so much to match the servers I was doing my coursework on I'll have to set them up again and just make minor changes.
I'll get back to you with is as soon as possible. One final thing you could try just while I remember is to put: PHP Code:
Like I say, I'll get back to you when I get my setup sorted out again. Jeffers
__________________
Wondering what ever happend to QA and where this Out Now, Patch Later culture came from!!!! |
|
#9
|
|||
|
|||
|
Okay, so I added that and now it shows the line "Error: Database Connection Failed" at the end of the original message. So there's some problem connecting obviously, but we still don't know what...
I know that if it works I'll get a simple message like this: Quote:
|
|
#10
|
||||
|
||||
|
ok, well I've got apache and mysql setup again, just need to do apache now.
I wonder why it gives you that message if it's successful. Will get back to you soon. Jeffers
__________________
Wondering what ever happend to QA and where this Out Now, Patch Later culture came from!!!! |
|
#11
|
|||
|
|||
|
Alrighty, I'll just be waiting here. No rush—I have plenty else to do in my spare time.
|
|
#12
|
|||
|
|||
|
I was looking on mysql.com a little more and I found that MySQL creates 2 users automatically under the username "root" that use no password. Therefore I can connect using one of those (tried it already and it works), but I still don't know why I can't use the username and password that I created using the mysqladmin.exe...
At least I can get a working connection now and I can keep going with my learning. Have to learn how to create and code a blog CMS so I don't have to keep updating the HTML files by hand. Bleck!
|
|
#13
|
||||
|
||||
|
Well, mine did work, but did some research into the problem cos it was annoying me. Anyway, I found something in my manual (should have looked there first, sorry) and found this:
Quote:
__________________
Wondering what ever happend to QA and where this Out Now, Patch Later culture came from!!!! |
|
#14
|
|||
|
|||
|
Thanks. I'll try that and see what happens.
|
|
#15
|
|||
|
|||
|
I just had a thought, it might not help but when i set a new username on my account it always adds _lydia (lydia being my log in name for the control panel) to the name, so if yours was doing that same that could be your problem.
|
|
#16
|
||||
|
||||
|
I don't know whether you tried setting the host file or not. But I finally got my configuration working again and tried setting up a user which worked. Although I didn't use the winmysql thing supplied with mysql, I used the MySql Control Center, downloadable from here: http://www.mysql.com/downloads/mysqlcc.html , which is quite a nice tool to use and can also be used to connect to remote databases. There are other tools on the mysql site you can use.
Just thought I'd let you know anyway. Hope your php and mysql are going ok. ![]() Jeffers
__________________
Wondering what ever happend to QA and where this Out Now, Patch Later culture came from!!!! |
|
#17
|
|||
|
|||
|
It's working now. Thanks again for the help.
![]() Nice download, too. Oh, and I found out I got a pretty bad book. I got past all the PHP stuff and started on the mysql commands. At the beginning of the section they said something like, "We are assuming you know how to execute queries for mysql." I was like ![]() No, I really don't... But I guess it doesn't take a genius to figure out, lol. And they don't fully explain things in the book, so thankfully I can look in the mysql manual (which I didn't know I had) and it seems to explain things thoroughly.
Last edited by Eddy Bones; 12-22-2004 at 09:31 AM. |
|
#18
|
||||
|
||||
|
One thing you might want to know should you ever need/want to set up another computer with apache etc.
There's a program around called Appserv which combines Apache/php/mysql in one easy to download and install package. It can also be of much use for people wanting to test some php website stuff on there own computer. I'll leave you guys at it now
|
|
#19
|
|||
|
|||
|
Awesome! Thanks for the info.
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|