Forum Moderators: travelin cat

Message Too Old, No Replies

mysql help please!

mysql configuring on OS X

         

cyclist

9:49 pm on Nov 18, 2003 (gmt 0)

10+ Year Member



Hi,

I have problem with mysql on my powerbook running OS X 10.2.8. I have started the Apache server and installed PHP and tried to install and set password for mysql. I´m a novice and do not know what I have done wrong. When I try to use phpMyAdmin-2.5.4 to set up mysql I get message:
Forbidden
You don't have permission to access /phpMyAdmin-2.5.4/index.php on this server.

It seems something went wrong with the first steps I took with mysql. Please advice what to do. I`m greateful for all input.

Thanks

Cyclist
Sweden

BjarneDM

2:38 am on Nov 19, 2003 (gmt 0)

10+ Year Member



That has nothing to do with MySQL itself.
You've got permission problems with the files in your phpMyAdmin installation.

If memory serves me right, phpMyAdmin is run through the Apache server.
Thus, the files installed by phpMyAdmin have to be readable by Apache - or more correctly : by either the www-user or the www-group. And not only that: each and every folder containing the phpMyAdmin installation has to be readable/executable by www.

To advise you better/more precisely, I need to know more about
- where in your file system did you install phpMyAdmin
- which user did you install phpMyAdmin as

cyclist

3:08 pm on Nov 19, 2003 (gmt 0)

10+ Year Member



Hi BjarneDM, thanks for your reply.

The phpMyAdmin-2.5.4-folder is located in my webb-folder (OS X/Library/WebServer/Documents/phpMyAdmin-2.5.4).

I installed as administrator. I have only one user (me).

I have uninstalled and then installed mysql again. This time without setting any security passwords.

Thanks
Cyclist

PS are you from Denmark?

BjarneDM

4:53 pm on Nov 22, 2003 (gmt 0)

10+ Year Member



Do a 'Get Info' in Finder on all of the folders in the path and make sure they are all readable and executable by World.

Go to your phpMyAdmin-2.5.4 folder and do a 'Get Info' in finder on the index.php file. Make sure it's readable by world.

If the above doesn't solve all of your problems, we'll have to turn to either the Terminal or 'Super Get Info' from BareBones

And : Yes - I'm from Denmark :)

cyclist

5:25 pm on Nov 22, 2003 (gmt 0)

10+ Year Member



Unfortunatley I´m a total novice when it comes to Terminal and these commands to use, it´s like greek to me. I´m actually surprised I managed to enable PHP in the first place :-)

I´m not sure what kind of application World is but I did the find info thing through the map structure and there was no problem.

I´m not sure mysql is working properly. Darn, it´s difficult trying to manage an own webserver with limited knowledge. Why can´t it just work easy and why can´t someone invent a graphic userfriendly environment? Sorry for the whine ;-)

Nice talking to a "neighbour" :-)

BjarneDM

11:38 pm on Nov 22, 2003 (gmt 0)

10+ Year Member



OK - you've got a swedish system then I suppose :)
Then, the spelling and wording ought to be almost the same as on my danish system.

If you select a file in 'Finder' and [ctrl]+click on it, you get a pop-up menu. One of the items on that menu is 'Vis info'. That's what you have to use whenever I wrote 'Get Info' in my previous answer :)

Now, 'Vis info' gives you a new window with at lot of - apparantly - confusing information. At the left of each line there's a triangle. Click on the triangle to the left of the entry named : 'Ejer og tilladelser'. The third entry named 'Andet' is my 'World' in my previous answer :)

The entry in the select-box to the right of 'Andet' should read 'Skrivebeskyttet' or 'Læse & skrive'. If it's reading 'Ingen adgang' you'll have to change it to one of the other two. You might also have to click on the lock icon in order for you to make the necessary change.

How did you install MySQL?
There's only one sure method that'll work no matter how you installed MySQL to tell whether it's running or not, and that's by using 'Terminal'. Start 'Terminal' and type the following : ps -U mysql . You should then get something like this:

[Titanen:~] bjarnema% ps -U mysql 
PID TT STAT TIME COMMAND
449 ? S 3:01.62 /Library/MySQL/libexec/mysqld

If you just get the first of these two lines, MySQL isn't running

Now, if you want i easy, I'll recommend you to switch to the Apache2, PHP4 and MySQL you can download and install from [serverlogistics.com...] . They'll give you lots of user-interfaces in the form of preference panes as well as easy to understand install instructions. Also, to administer MySQL I'ld recommend YouSQL - [versiontracker.com...] -

cyclist

6:37 pm on Nov 23, 2003 (gmt 0)

10+ Year Member



Yes, I know how to get info, I was just unfamiliar with the terminology. I use "apple"-"i" to get info though.

All the way in my map structure "Ägare och behörighet" is set to "Läsa och skriva" and "Skrivskyddat".

I get following message in Terminal:

[Anders-Karlstams-dator:~] anderskarlstam% ps -U mysql
PID TT STAT TIME COMMAND
374 ? S 3:28.75 /usr/local/mysql/bin/mysqld

Seems OK?

/cyclist

cyclist

7:10 pm on Nov 23, 2003 (gmt 0)

10+ Year Member



PS.
I installed mySQL after an step by step guide found in a Swedish magazine (did not work on all commands they suggested though) and on Internet:
[swanilda.com...]

There is dercribed how to enable PHP, how to install mySQL and how to install and configure phpMyAdmin, and it´s here I got stuck :-)

As far I can see the other things went well. I even managed to install a script making mySQL a startup item. First and second time I tried to install the script it did say that installing on my disc (HD) was not possible. Don´t ask me why... something about "null". Then I connected my external Firewiredisc and when trying again it was possible to install. Odd!?

Thanks
/cyclist

BjarneDM

7:48 pm on Nov 23, 2003 (gmt 0)

10+ Year Member



OK - your 'ps -U mysql' result shows that your MySQL server is indeed running.

Now, when you do a 'Vis info' the settings are reported for three separate entities: Ägare , gruppa , andre - or whatever they are called in swedish. It's the settings for the third : andre , that's interesting. From your answer I can't see clearly for which of the three you've reported the settings. Also, what are the settings for the folder phpMyAdmin-2.5.4 and the file index.php within that. And again it's the settings for the third - andre/andet - that's interesting.

The problem is, that the Apache server has it's own user and group - both called 'www' - that it for security reasons is running as (ps -U www). As a consequense, Apache can only see and access files and folders where the settings for 'andet/andre' are correct. That means : every folder has to be not only readable but also executable, and every file has to be readable.

Unfortunately, the 'Vis info' in Finder has only limited abilities to report all possible settings. All in all there're 8 different combinations where Finder only gives you a choice between three :( A much better program for setting owner, group and permissions is 'Super Get Info' from BareBones - those of BBEdit fame.

Let's try 'Terminal' again :) type: 'cd /Library/WebServer/Documents/ ; ls -aloF'
you'll get some lines like these:

drwxrwxrwx 11 bjarne staff - 374 Nov 23 01:45 grafik/ 
-rw-r--r-- 1 bjarne staff - 1859 Nov 22 22:21 index.xhtml

the first of these lines is a folder indicated ly the d first in the line and the / at the end of the line. The second is a file. Now, pay attention to the first 10 letters. The first letter indicates file/folder/link, the next 9 are the permissions in groups of three. It's the third group of three lettes that'll be interesting in your case. For Apache to be able to get into the phpMyAdmin-2.5.4 folder they have to be r-x or rwx. If not you'll have to fix the settings : 'sudo chmod -R 755 phpMyAdmin-2.5.4' and enter your own admin password at the prompt.

Now, type: 'cd phpMyAdmin-2.5.4 ; ls -aloF' and check the settings once again. They have to be one of these four : r-- r-x rw- rwx , in the third group for all of the files. If you need to change the settings for all the files do this : 'sudo chmod -R 755 *'

If you want to know what I'm up to you can get help in 'Terminal'; type:
man sudo
man cd
man ls
man chmod

good luck ;)

cyclist

10:50 pm on Nov 23, 2003 (gmt 0)

10+ Year Member



Oh man that is greek to me :-), I´m gonna try this. This is the first result:

1. As the last line starting with letter "d" does not have r-x or rwx as the last tre letters of the ten first letters I´ll take step two and here are the result after typing the commands:

2. All lines starting with letter "d" now ends with r-x.

I have just updated my system to 10.3. This because I will use a mailserver that´s better than the one built in to 10.2.8. Now it looks like I have to install PHP once again. I will look into it tomorrow. Thanks Bjarne for your help this far. If you have any comments or suggestions please feel free posting them :-)

The settings for the folder phpMyAdmin-2.5.4 and the file index.php within the folder is the same:

Ägare och behörigheter:
Du kan: Läsa och skriva

Detaljer:
Ägare: anderskarlstam
Åtkomst: Läsa och skriva

Grupp: staff
Åtkomst: Bara läsa

Övriga: Bara läsa

/cyclist

BjarneDM

3:04 pm on Nov 24, 2003 (gmt 0)

10+ Year Member



YES! That was your problem : Apache simply wasn't able to get into the phpMyAdmin-2.5.4 folder.

But if you more or less are starting from scratch anyway, my advise it to take a good hard look at the free downloads of Apache, PHP4 and MySQL from [serverlogistics.com...] . They are so much easier to administer than what Apple bundles and what you can get with Fink.

As to the mail-server, I'm stil using 10.2.8, but I've installed postfix and thrown sendmail out. At present though only as a smtp sender as I've got an old PowerBook 520c with Mac OS 8,1, PPC 603e, 56MB and 18GB HD as my main mail server. It's running 24/7 and is only rebooted when the power fails. Last time I had to reboot it was the fault of you Swedes ;)

cyclist

9:51 pm on Nov 25, 2003 (gmt 0)

10+ Year Member



Thanks Bjarne for your help.

/cyclist