|
#1
| |||
| |||
| Über n00b setting up PHP and MySQL - shell syntax problem? Hi everyone, Here's where I'm at so far: I have d/l and installed the PHP module from Mark Liyanage (http://www.entropy.ch/software/macosx/php/). I have d/l and installed the MySQL pkg file from MySQL.com (the one for OSX) I have been following a tutorial on MacWorld's site that I remembered reading a while ago: http://www.macworld.com/2002/11/features/database/ Here's what IS working: PHP is installed and running - accessing the test.php file I created gives me the page Mark says it will on his site (also in the MacWorld tut). MySQL is installed and the PrefPane says it is running. (Startup item was also installed) Here is the problem: In the Macworld Tutorial (and others I've seen online), you set up your password in the config.inc.php file, which I did. I also set up the $cfg['Servers'][]['auth_type'] = 'config'; line to read "http" between the single quotes. When I try to connect to MySQL through PHP MyAdmin it says the password is incorrect. So back to the MacWrold tut, it says to set your password in MySQL by typing the command: rehash; mysqladmin -u root password newpassword where newpassword is the password that you put in the config file. Problem is, this tut was written when the shell was tcsh and not bash. bash doesn't like the rehash command, and hash doesn't work properly with the commands that follow it. First thing I tried was to try what they suggest in the MacWorld tut to test and see if the MySQL install really _was_ running, and went to Terminal and typed mysql -u root -p. Password _still_ doesn't work. Suggestions? Thanks in advance for taking time to read this! :m |
|
#2
| ||||
| ||||
| I see from that confic.inc.php linethat you're using phpMyAdmin ? It's usually a good idea to include information like that, because it's in fact (probably) not MySQL that not working properly, but phpMyAdmin. Did you change your root mysql password when you installed it ? If you used the .pkg installer (which is IMO the way to go on OS X) you won't have. MySQL keeps its passwords in its own database, so it WON'T be the same as your Mac OS X "root" users password. Try logging in in the Terminal like this mysql -u root (without the -p) If that works then you have your problem. Type this then in the terminal (to change your root password, note that the first 'password' there is not your current password but is a command, the second one in quotations marks IS a new password): mysqladmin -u root password 'mynewpassword'
__________________ michaelsanford.com • Blog • Twitter • Tumblr • LinkedIn • iMac Aluminum 24" | MacOS X 10.5-current | 3.06 GHz Intel Core Duo | 4 GB RAM | 1 TB HDD • iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD • AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2•120 GB RAID 1, 2•500 GB RAID 0 |
|
#3
| |||
| |||
| Something's not right... Hey Michael - thanks for your reply. I *did* change the password in th config file to what I wanted it to be, but still no dice. I just tried your suggestion of logging in to MySQL without the password, and I get the following: -bash: mysql: command not found I did install MySQL using a .pkg installer and if the PrefPane is any indication, the install DID work. I should also mention that I am running the latest version of OS X (10.3.8) with all of the latest updates. Thanks for your help so far and hopefully you'll have some insight as to what's happening here. :m |
|
#4
| ||||
| ||||
| When you say " I *did* change the password in th config file to what I wanted it to be" you mean in config.inc.php ?
__________________ michaelsanford.com • Blog • Twitter • Tumblr • LinkedIn • iMac Aluminum 24" | MacOS X 10.5-current | 3.06 GHz Intel Core Duo | 4 GB RAM | 1 TB HDD • iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD • AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2•120 GB RAID 1, 2•500 GB RAID 0 |
|
#5
| |||
| |||
| Yes, that's correct. I left 'root' but changed the pass to what I wanted it to be...then saved the file. :m |
|
#6
| ||||
| ||||
| Ok that's what I'm talking abuot--you're confounding phpMyAdmin, which is a web based INTERFACE for MySQL, and the ACTUAL MySQL SERVER. In the terminal do this: ps ax | grep mysqld | grep -v grep Do you get a line that looks like this 352 ?? S 5:34.55 /usr/local/mysql/bin/mysqld --defaults-extra-file=/usr/local/m....blah blah Or do you get nothing ?
__________________ michaelsanford.com • Blog • Twitter • Tumblr • LinkedIn • iMac Aluminum 24" | MacOS X 10.5-current | 3.06 GHz Intel Core Duo | 4 GB RAM | 1 TB HDD • iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD • AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2•120 GB RAID 1, 2•500 GB RAID 0 |
|
#7
| |||
| |||
| Actually, Terminal flicks for a split second, then I get my default prompt... it doesn't show anything at all... :m |
|
#8
| ||||
| ||||
| Ok that means your mysql server isn't actually running. Also I'm concerned about your bash: error because it means that it can't find the mysql client program to communicate with the mysql server. You ran the mysql.pkg installer and installed the startup item also ? In the Terminal type ls /usr/local/mysql you should get output like this: homestar-runner:/usr/local/mysql root# ls /usr/local/mysql COPYING bin include scripts tests EXCEPTIONS-CLIENT configure lib share INSTALL-BINARY data man sql-bench README docs mysql-test support-files If it says instead ls: /usr/local/mysql: No such file or directory Then either Mysql got installed in a funny place, or the install didn't work properly. If the second one is the case, try reinstalling the .pkg. Just remember, phpMyAdmin is not MySQL itself, it's just an interface. Think of it like the phones in your house. You can pick up any number of different telephones but they all ring the same number, right ? That's like phpMyAdmin. It's just one of the numerous ways you can communicate with MySQL, which would be the phone line in this analogy. Editing config.inc.php has NO effect on MySQL's passwords. Incidentally, if you select the http config method you don't need to put in a password because you'll be prompted for one when you hit the page with your web browser.
__________________ michaelsanford.com • Blog • Twitter • Tumblr • LinkedIn • iMac Aluminum 24" | MacOS X 10.5-current | 3.06 GHz Intel Core Duo | 4 GB RAM | 1 TB HDD • iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD • AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2•120 GB RAID 1, 2•500 GB RAID 0 |
![]() |
| Thread Tools | |
|
|