[HOWTO] - Setup PHP & MySQL

Status
Not open for further replies.
yoshi,

thanks for the reply. i went to look for some type of chat add-on to this site but couldn't find anything. also checked your profile and such for more icq details. i jsut found the site this morning and i don' tknow where you guys hang out.

let me know more details if you can..i'd lvoe to catch up with you guys.

-
 
I am newer than the newest to all of this...

The PHP part went fine, but the MySQL part won't budge. At the command:

cd usr/local/mysql

...I get:

usr/local/mysql: No such file or directory.

I did setup MySQL User correctly. Please help.:(
 
further to this (after just reading Admiral's excellent Unix intro commands), I realise the cd command is to just get me into a directory. Assuming this, I navigated to the mysql user folder which is:

[localhost:/Users/mysql]

Am I right?:confused:
 
Sorry to bore you, but my knowledge of this is expanding every minute.

I realised the above directory is not the one I want. I managed to navigate to:

[localhost:/usr/local]

When I do an ls command I get:

bin etc info man

... Sooo, obviously no mysql directory! Can you tell me why? (Again, I followed the simple User setup instructions).;)
 
I created the missing mysql direcotry using:

mkdir mysql

then went in to the directory and carried on with the instruction:

sudo ./scripts/mysql_install_db

but go:

sudo: ./scripts/mysql_install_db: command not found

???
 
I've time to play with both MySQL and PHP separately. I'm trying to connect PHP to MySQL and having trouble. This is what I'm using

mysql_connect("localhost","nothing","password") or
die ("Could not connect to database");
mysql_select_db("guestbook") or
die ("Could not select database");

I've tried using mysql_connect("localhost","root","mypassword"), but no luck.
Is there another step to the install of MySQL and PHP for the two to work together or is the script wrong? :confused:
 
I successfully installed PHP, but I can't install the mySQL portion of this tutorial. I created the mySQL user exactly as it said, but I can't do a "CD" to the /usr/local/mysql folder.

I don't understand what I should do. I am running OS 10.1.3. Is there software that needs to be installed other than the sql setup and php setup?

:confused:
 
If you followed my escapades, I had exactely the same problem.

What I did was go to AdmiralAK's Unix command tutorial on this forum, and learnt the (very simple) commands to create the directory.

First use:

cd ..

Several times until you go back to the topmost directory (the cd command being the navigation command into a directory, cd .. takes you back 1 directory). Then, do:

ls

This list the directory your in. You should see the usr directory. Do the:

cd usr/local

Then do another:

ls

You should see a mysql directory... No, neither did I, so I created it!

Type:

mkdir mysql

The mkdir is basically make directory. Then:

cd mysql

You are now in the mysql directory, just as the part you where stuck on intended.

I did worry about going off and doing this, but everything installed fine after that and worked! (Don't forget to install the MySQL package file once you've downloaded it) I say this 'cause I forgot that part!;)
 
Okay, so I have all up and running as per the instructions. My question is this:

I have a finished web site (finished a few months ago for a client), my tech person developed a MySQL and PHP database for reports to be published, updated, added, deleted etc. He has since left (we have also since decided to take the client to court:eek: ). Anyway, how can I test the site on my new fantatic discovewry of a MySQL and PHP enabled MacOSX!?

Is this a relatively simple answer, or is too much of a question and I should go get a book or hire another techy?;)
 
u should ak your tech person to come over and give you a short tour of mysql and create the dataases for the php script.
 
I went to the /usr/local folder and tried to mkdir, but I got a "permission denied" message. I am logged in as an Administrator. I also got a "permission denied" error when trying to chmod a CGI script.

How do I get permission to make these changes?:confused:
 
I'm not uoba, but just use sudo in the terminal:

sudo mkdir mysql

enter your adminisitrator password

(I assume that's the command you're talking about, but it'll work for other commands as well anyways)
 
thank you. Now I have the mysql folder there, but I can't execute the next commad. This is what I get
PHP:
[localhost:~] lchakov% cd ..
[localhost:/Users] lchakov% cd..
[localhost:/] lchakov% cd /usr
[localhost:/usr] lchakov% cd /usr/local/mysql
[localhost:/usr/local/mysql] lchakov% sudo ./scripts/mysql_install_db
Password:
sudo: ./scripts/mysql_install_db: command not found
[localhost:/usr/local/mysql] lchakov%

I don't think I installed the correct mySQL files. Can anyone link me to the correct setup for mySQL?
 
I don't claim to know anything about setting up MySQL, but instead of doing

sudo ./scripts/mysql_install_db

you can try

cd scripts

sudo ./mysql_install_db

that might work, but if not then there's probably some missing files like you say.
 
My tech person is in Bulgaria, I am in the UK!!:rolleyes:

MrHappyMonkey, here's the link to the MySQL download I used:

http://www2.entropy.ch/download/mysql-3.23.49.pkg.tar.gz

Once you download it, uncompress it until it becomes the package (signified with the box package icon), then double-click that, which takes you to the installer. Follow the installation instructions from there. Once done, try your command again.

I think that was the message I was getting when I neglected to actually install MySQL.

If you've done this already, and you still get that message, then my knowledge ends there I'm afraid.:(
 
Status
Not open for further replies.
Back
Top