[HOWTO] - Setup PHP & MySQL

Status
Not open for further replies.
Humm. Now i have the same problem i used to. I can't pass variables. I tried to follow the instructions on the previous page, create a php.ini file with register_globals On and it didn't help.

Any ideas with this one?

Twister

[ UPDATE ] I searched the net for php.ini and found out it's supposed to be register_globals = On. Not register_globals On
 
im running mac os 10.2 with mysql 3.23.51

whenever i try to "log into" mysql with the terminal to create a new database, edit permissions or whatever .. i always recieve this error:

Code:
dyld: ./bin/mysql Undefined symbols:
./bin/mysql undefined reference to _BC expected to be defined in /usr/lib/libSystem.B.dylib
./bin/mysql undefined reference to _PC expected to be defined in /usr/lib/libSystem.B.dylib
./bin/mysql undefined reference to _UP expected to be defined in /usr/lib/libSystem.B.dylib
Trace/BPT trap
if anyone could point the problem or what not.. it would be greatly appreciated... thanks much
 
:(
dyld: ./bin/mysql Undefined symbols:
./bin/mysql undefined reference to _BC expected to be defined in /usr/lib/libSystem.B.dylib
./bin/mysql undefined reference to _PC expected to be defined in /usr/lib/libSystem.B.dylib
./bin/mysql undefined reference to _UP expected to be defined in /usr/lib/libSystem.B.dylib
Trace/BPT trap

I run into the same problem.

Though I've searched all over, I have found a few other references to this problem, but no solutions. It's starting to hamper me, because I can't dump client databases into my local mysql.

Anybody know what's going on?
 
OK, let me start by saying a HUGE thank you to Marc Liyanage, yoshi, and everyone else in the thread who has helped out. This thread got me running back when I first installed 10.1, and I am hoping it can get me over a hump now that I (clean) installed 10.2.

I used Marc Liyanage's page for everything and now PHP is installed and running, and so is MySQL, but I can only access MySQL with the root user. I have tried adding rows to the users table through phpMyAdmin as well as GRANT statements in the terminal- obviously neither worked.

Last time I installed these things, somewhere along the way I had to create an actual MySQL user for OSX- this time I did not see that step listed anywhere. I tried to go into the profiles anyway and create a mysql user and it said there was already a user with the short name 'mysql'. However, my main user profile is the only that shows up.

I feel like I am so close... can anyone help me?
Digi
 
Hello all...

I am running 10.2 and have both PHP/MySQL running. Don't ask me how. I used Marc L.'s mysql installer, HOWEVER it seems there is a built in mysql user on OS 10.2. When I tried to add a mysql user, there was already an existing account. I used NetInfo to figure out the password, but to no avail. It just has an asterick.

Here is the order of what I did:
1. Turned Apache on.
2. Installed PHP
3. Installed MySQL
4. Restarted Apache
5. Installed Marc's auto startup for mysql
6. Restarted Apache
7. Restarted iBook

This is a hashed together sequence of events that occurred over a period of four days.

I now have a db named 'test' that I have NO IDEA how it came to be. I also am able to use phpMyAdmin to work on it and have set up everything on my iBook that I have online.

The only thing I can figure out is that we no longer need to *do* as many things with 10.2 as we did in 10.1 to get Apache/MySQL/PHP running. I have a sneaking suspicion that because MySQL is in the Apache directories, that the mysql user name was automatically created upon software installation.

But we seriously need someone who understands all sides of this situation to explain fully what's going on. I can only tell you that I'm working, that I'm happy, and that I consider myself to have had a bit of luck.

regards,
-+vurt
 
By no means am I an expert, but I did recently get all of this working under 10.2

As far as I can tell, you are right- the mysql user is created automatically, thereby reducing the steps required. The test database is always installed with MySQL. The problem I had was getting access to other databases with any user besides the mysql root user. To fix this I did:

//log in as root in terminal
sudo su
//enter password for system root user- should log you into terminal as root
//then log in to mysql as the mysql root user (remember mysql and system each have their OWN root user)
mysql -u root -p
//enter password for mysql root user- should take you to mysql prompt
//then use a simple grant statement
grant all privileges to me@localhost identified by 'myPassword';


Hope this helps someone who may be stuck at this point.
Digi
 
Digi...

Thanks a lot! That helps clarify some things. One question: since there is already a mysql user set, how do i find out and change the root user for mysql? That's where I got miserably stuck.
 
meta, I think maybe you are getting confused a little (kinda like I was for a long time). The mysql user is set by default by OSX for OSX, ie- I login to my comp as bclink, it creates another user named mysql.

When you install MySQL it creates a default root user for MySQL with no password attached. You should give the MySQL root user a password, and then create another MySQL user (see my previous post) to use for everyday db access.

There are pretty good instructions at http://www.entropy.ch/software/macosx/mysql/ (where you probably installed from), but you basically do this:

mysqladmin -u root password new_password_here

replacing new_password_here with whatever you want the password to be of course. Let me know if this doesn't clear things up.

Digi
 
digi, my problem is that i cant even log in as the root user. i even have a password set for the root user. every time i try to log into mysql, i just get the errors that i listed in my post above. you have any idea what is wrong?

thanks much for the help
 
honestly I have no idea what those messages mean, sorry. If you are sure you set the mysql root users pass already and it is still not working I would just reinstall MySQL from the link I posted above. If there is a chance the MySQL root user has remained untouched, try logging in like this:

mysql -u root

if there is no password for the root it should bring up the mysql> prompt, and then you can set the password by following the process I mentioned above.

Sorry if I am not much help. It took me several tries to get mine working so dont be afraid to try reinstalling MySQL to get a fresh start. As for creating databases and stuff I would HIGHLY recommend installing phpMyAdmin. It creates a GUI for MySQL and makes it much easier to manipulate your databases and data.
http://www.phpmyadmin.net/
 
hey digi.... thanks much for the reply, i really appreciate it... i was planning on just going ahead and reinstalling MySQL... that brings me to one more question... what is the best way to uninstall MySQL?

again, thanks much for everything.
 
I am pretty sure you don't need to uninstall. I think that reinstalling will just overwrite the old copy.

Check the entropy site (link is in previous posts) for more details. Anyone else know for sure about this?

Digi
 
First, a great thanks to Yoshi! With your instructions, I installed PHP and MySQL without problems in 15 min :)

However (there is always a "however" in CS ;) ), I get an error when trying to create a new database in MySQL:

mysql> select user();
+----------------+
| user() |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)

mysql> create database pastiches;
ERROR 1006: Can't create database 'pastiches'. (errno: 13)

As you can see, I logged in as root to make sure I would have the permissions, and simply tried to create a databse, as explained in the MySQL manual...
Anyone has an idea of what went wrong?

TIA,

Kinniken
 
Hey all,
First off to those who needed help in the last few weeks I apologize I have been busy (and still am) with things like moving out, getting an internet connection and whatnot.

Second of all I plan on getting a copy of MacOSX 10.2 and updating this howto. Until then its basically 10.1.x only. So I apologize for the inconvinence, just know the update is coming.

Now to kenniken:
Try installing phpmyadmin and see if you get a simular issue because as far as I see your all good there.


~Yoshi
 
Ohh no... I went to add something to the php.ini file and it didn't work well here's what happened

----------------
[MacMan:~] work% cd /usr/local/
[MacMan:/usr/local] work% ls
bin lib mysql-3.23.51
include mysql share
[MacMan:/usr/local] work% cd lib
[MacMan:/usr/local/lib] work% sudo pico php.ini
Password:
dyld: pico Undefined symbols:
pico undefined reference to _AL expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _CE expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _CL expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _CM expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _CS expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _DC expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _DL expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _DM expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _ED expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _EI expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _IC expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _IM exTrace/BPT trap
---------------------------

Now what? How do i erase the existing file and create a new one? Of fix this one?

Twister
 
I think I have MySQL installed ok, but I can't seem to test this thing. Here is my terminal transcript, what am I doing wrong?

[Charles-Klines-Computer:/] root# cd /Library/MySQL/
[Charles-Klines-Computer:/Library/MySQL] root# sudo chown -R mysql /Library/MySQL/*
[Charles-Klines-Computer:/Library/MySQL] root# sudo ./bin/safe_mysqld --user=mysql &
[1] 1255
[Charles-Klines-Computer:/Library/MySQL] root# A mysqld process already exists
mysql test
mysql: Command not found.
[1] + Exit 1 sudo ./bin/safe_mysqld --user=mysql
[Charles-Klines-Computer:/Library/MySQL] root# mysql test
mysql: Command not found.


Thanks
Charles :confused:
 
Update! I finally got it all working. I was trying to get this all setup from my standard user. I created a user called root and went through the setup steps again and now everything is working!!

The funny thing is, I was not able to actually use MySQL until I logged out from the root account and back in with my normal login which is an ADMIN but still... is this normal?

Also, when I tried to create a database I got a 1044 error. Any thoughts on this?

Thanks for all the help here.
Charles
 
I followed the ules to install php, all went fine, then i went to check if it works. I see the php code in browser, instead of seeing the script right. I open the page and i see <?php phpinfo(); ?>as if it was the content

anyone else experienced this?

btw I´m using: iMac 700mhz, OS X 10.2
 
Status
Not open for further replies.
Back
Top