|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
PHP doesnīt show errors / MySQL User and Host not set
Hi there,
Iīm just getting started with Macs and actually Iīm a bit desperate trying to get PHP and MySQL working. Iīve already done this on a PC many times without any problems. But on a Mac??? I installed PHP and MySQL like entropy.ch says. First problem: Even though I have put ALL error-reporting functions ON in the php.ini, I donīt get any error reports at all. The only thing I get when running a php-file is blank pages, thatīs so annoying. PHP seems to be working alright, at least I have no problem running phpinfo. Second problem: When I run phpinfo I get the information (in the mysql section) that MySQL didnīt set any user nor host. But I need these to connect to a db. When you install MySQL on a PC these things (User, Host) are set automatically. I have really tried hard: installed everything again twice, done all the installation-manuals available on the web... If it is any help to you: I have checked with NetInfoManager that there is an mysql user. I donīt know ANY Unix, but Iīm following the installation guides. I understood that Iīm supposed to change the password for the mysql user. If I try, I get this: [MIS-Computer:/usr/local/mysql] inti% sudo chown -R mysql:mysql data [MIS-Computer:/usr/local/mysql] inti% sudo ./bin/safe_mysqld --user-mysql & [1] 613 [MIS-Computer:/usr/local/mysql] inti% Starting mysqld daemon with databases from /usr/local/mysql/data 030806 11:52:29 mysqld ended /usr/local/mysql/bin/mysqladmin -u root password XXXX /usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)' Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists! [1] + Done sudo ./bin/safe_mysqld --user-mysql [Maria-Inti-Metzendorfs-Computer:/usr/local/mysql] inti% Hope anybody has any hints for me! |
|
#2
|
||||
|
||||
|
Check out mysql.com for complete info on how to set up privileges. Out of the box, I believe mysql can usually be accessed as root with no password. Of course you'll want to set up a web user with a password and limited permissions. Info on how to do all of this is available at mysql.com.
If phpinfo runs fine but you're getting blank pages on other code, I'm guessing it's a code issue. We'd have to know what these blank pages are supposed to do in order to provide any meaningful feedback. |
|
#3
|
|||
|
|||
|
Thank you for replying.
I really donīt think itīs a code issue, because all I want are the error reportings. If I write something like this on a PC <? echo "Hallo!" ?> I would normaly get something like "; missing in your syntax" But here I get nothing. Just blank pages. As soon as something in the code is wrong, he gulps down everything. This way I canīt figure out if Iīve got a PHP or a MySQL problem, because alle error reportings are omitted (even though I changed php.ini to ON!) |
|
#4
|
|||
|
|||
|
I solved the PHP problem by installing it all over again... Unfortunately this didnīt work with MySQL. I keep getting this error:
[127:/usr/local/mysql] inti% sudo echo [127:/usr/local/mysql] inti% sudo ./bin/mysqld_safe & [1] 1311 [127:/usr/local/mysql] inti% Starting mysqld daemon with databases from /usr/local/mysql/data 030806 17:26:27 mysqld ended /usr/local/mysql/bin/mysql test ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) [1] + Done sudo ./bin/mysqld_safe [127:/usr/local/mysql] inti% What am I to do now? (Iīve already used the CLEANUP Script from entropy.ch and started all over again...) |
|
#5
|
|||
|
|||
|
I'm getting the exact same problem with mac os 10.2.5
try to start mysql, gives this response: Starting mysqld daemon with databases from /usr/local/mysql/data 030901 05:02:15 mysqld ended I'm very new to this and I don't have a clue what I'm doing wrong. |
|
#6
|
|||
|
|||
|
ok, i figured it out.
Open a terminal window and type in the following commands (without the double quotes): type cd /usr/local/mysql type sudo chown -R mysql data/ enter your Mac OS X account password when asked for it. To start the server, issue (type) sudo echo first, then type sudo ./bin/mysqld_safe & Use it with /usr/local/mysql/bin/mysql test If you do not want to have to type /usr/local/mysql/bin in front of every command, you have to add the /usr/local/mysql/bin directory to your PATH environment variable in your login script. For the default tcsh shell, you can do this by running this command once: echo 'setenv PATH /usr/local/mysql/bin:$PATH' >> ~/.tcshrc I got this off from: URL hope this works for you. |
|
#7
|
|||
|
|||
|
hey there,
im having the same problem with php, there is an error in my script somewhere and I cant debug it because all php gives me is a blank screen! how do i fix this, as it is really annoying! phpinfo() is executed ok, as are any normal php pages, but just not any that have an error, it stops output of errored pages! how do i fix this?! or how do i re install php? am using mac os x 10.3.7. help!!! please!!!! |
|
#8
|
||||
|
||||
|
You might get better results in a new thread.
in the meantime, try adding an or die(); statement to the end of your mysql_query statements... [all your mysql statements would give you better debugging]... I find this is a common problem, and it should give you a better idea of where the problem lies. Does PHP not output *at all*... or only on scripts with MySQL connections? |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > PHP doesnīt show errors / MySQL User and Host not set |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|