Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

xper

macrumors 6502
Original poster
Dec 15, 2005
430
3
Sweden - Halmstad
Hi!

I don´t like MAMP anymore and since Apache and PHP ships with OS X i want to use those!

I downloaded cummunity server, latest beta, on mysql.com, installed it fine and it shows up in pref!

The problem now is that PHP must know where to connect to MySQL and the documentation on mysql.com is longer than the bible and describes how to hike in the andeés 120% more than they talk about mysql.

Anywhay, MySQL is now installed on /usr/Local/MySQL and PHP god knows where.

Anyone that can guide me?
 
I strongly suggest you use MAMP, it's way easier, and the reason you're not currently doing it does not make any sense, most probably.

Anyway, if you're looking for a script, here it is:
PHP:
mysqli_connect('host', 'username', 'password', 'database_name', 'port', 'socket');

For example, for MAMP's MySQL settings:
PHP:
mysqli_conenct('localhost', 'root', 'root', 'test', '8889', '/Applications/MAMP/tmp/mysql/mysql.sock');

You can also always check PHP's official documentation
 
Well, the term "anymore" means that i have used and use it currently but i dont want to use it anymore, and i need to know how to install mysql for future deplyment!

I am not looking for a script, i know how to connect to a DB but for that to work i need a DB to connect to, i need to specify something in php.ini so php know where mysql is located and stuff
 
Great, thank you!

It works now but i am having one more problem, i am only allowed to upload a 2mb SQL file through phpMyAdmin and my SQL file is alot bigger then (that?), where is the MySQL config located? I only find config.huge.ini, config.medium.ini and so on but how do i know which is activated?
 
Well, it seems like i dont have a file called my.cnf, looked in every relative folder and searched for it but no luck :S
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.