Help me launching PHP/MySQL development on localhost please !

toast

Gone !
I'm throwing myself in the PHP/MySQL world. What I have done:

- Installed PHP, and it works.
- Installed MySQL using the appropriate package.
- Installed phpMyAdmin in my ~/Sites.

I do have modified my config.inc.php file. Here's what I modified in it:

Code:
$cfg['PmaAbsoluteUri'] = 'http://127.0.0.1/~toast/';
$cfg['Servers'][$i]['host'] = 'http://127.0.0.1/~toast/'; // MySQL hostname

$cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?

$cfg['Servers'][$i]['user'] = 'toast'; // MySQL user
$cfg['Servers'][$i]['password'] = 'fakepass'; // MySQL password (only needed with auth_type

The username is my OS X session name. The password is my OSX user password. I'm a super user on my computer (I run only one session).

Now, I open Safari and ask for http://127.0.0.1/~toast/phpmyadmin/index.php. I enter toast/fakepass, but it won't accept it ! What's wrong please ?
 
I would say change the first line to the directory where phpMyAdmin is (i.e. http://127.0.0.1/~toast/phpMyAdmin/)

(The title of this $cfg string is PmaAbsoluteUri... the 'Pma' bit meaning phpMyAdmin).

Just looking at my phpMyAdmin install (which I know works), I have auth_type as config as well.

Did you change the controluser and controlpass to your details as well?

Finally, if you've tried the above, try host as localhost/~toast/
 
Succeeded by adding /phpmyadmin/. Had problems with the GRANT command, why does it work so... randomly ? This whole PHP/MySQL is too complex for non-geeks.

I'll post my next problems very soon... :rolleyes:

Off-topic: how do you get your root password back when you forgot it :p ?
 
New problem already bumped.

Trying to create a database connection in DWMX. I've set up my site, I work on local env in http://127.0.0.1/~toast/.

I create a PHP file and ask for a connection (from the databases palette):
name=connToast
MySQL server=http://127.0.0.1/~toast/ (WTF could it be ?)
usr=toast
pass=myOSXuserpassword
database= when I click on Select, it gives 2005 UNKNOWN error. I can't believe it ! I'll end up trashing this whole dynamic thing soon if it continues. Or maybe I'll wait for this O'Reilly PHP/MySQL book.

My problem is, the Glasshaus book I bought gives NO instructions for Mac ! Gonna kill'em. Uoba, thanks for your first post. Second one ? ;) :p Pleez, I'm such a dummy I feel like I'm gonna buy the whole Sybex suite tomorrow.
 
Take it easy Toast ;):)

You'll find MySQL the easiest out of them all. All you have to remember is, that your machine is the MySQL server, not any specific directory. Therefore, your MySQL server is simply 127.0.0.1 or even just the word localhost. So, just take off the ~toast/ bit again.

If you want to get your root password back... grab your OS X install CD and boot from it... there's an option somewhere to reset the root pass.

As for the Glasshaus book, all the Dreamweaver bits are essentially the same for the Mac. As for the MySQL stuff and PHP, I spent about a year learning it before using it in Dreamweaver (via the command line). This helped understanding it a lot more easily.

Let me know if it works.
 
I'm out to drink something fresh that'll help me not bashing my forehead against the Dreamweaver Connection window and I'll try all this. Thank you again. I have an O'Reilly PHP/MySQL book, but I'm moving and I can't wait to program in PHP. I'm skipping some steps, thus, not the best thing. I'll guess it'll be okay in an intensive month or so. There will be loads of bashing foreheads before that. Or loads of refreshments :p
 
No, nothing changed. How do you do yourself ? Did you install MySQL thru a package or by source ?
 
I installed Marc Liyanage's MySQL from http://www.entropy.ch

You can test MySQL from the command line by typing:
cd /usr/local/mysql

./bin/mysqladmin status


This should report your MySQL status (if it is up!)

If it isn't, then MySQL isn't running. This may be simply because you've turned your machine off... MySQL needs to be started up again after shutdown or a restart. To do this, follow the instructions from the MySQL install page on the above link (number 5 through 7).
 
Uptime: 13575 Threads: 1 Questions: 1285 Slow queries: 0 Opens: 23 Flush tables: 1 Open tables: 8 Queries per second avg: 0.095

It is running. I'll find my root and reinstall it properly before posting again. Something must have gone wrong. I'll also check the DWMX help.
 
I'm pretty certain it's something you're doing in DWMX.

Can you get into the MySQL application from the command line? (When you meant root password, did you mean for MySQLm I thought you meant the system ;) )?
 
I meant the system, I'll be running the Jaguar CD as soon as I ... find it (it's lost in hundreds of CDs all messed up in one big cardboard box somewhere in the bathroom).

As if it wasn't complex enough, I think I'm gonna have to work on a distant server... or maybe that's simple, finally ?

- MySQL/PHP are already installed.
- I have a single login/pass on this server.
- Drwback: I'm not a superuser.

I'll add more to this thread soon. I'll end up writing a tutorial for what I'm tyring to achieve if I succeed (notice the 'if').
 
Soon is not the right word (not before September, as I'm off), but you'll see my PHP some day, sure. Thanks for support :)
 
Back
Top