# OS X server - phpMyAdmin?



## wicky (Jun 29, 2008)

I'm setting up os x server (10.5) for the first time and could really do with a little advice.

I'm used to doing much of my web development on a local MAMP install, and I'd like to replicate a similar set up on the server.

I understand that PHP & MySQL are pre-installed on the server, but I've always done all of my admin via phpMyAdmin so don't really understand where to add a new database.

Can anybody tell me how to install phpMyAdmin in the relevant place, or alternatively, point me towards some other help/ instructions.

Thanks


----------



## michaelsanford (Jun 29, 2008)

You can install phpMyAdmin in any location that apache can serve files from.

To add a new database in the command-line, you can, from the shell, run

```
mysqladmin -u root -p create <database_name>
```
or, from inside mysql:

```
create database <database_name>;
```
Though you do not need to do it as the MySQL 'root' user, but as any user with create permissions.

I must add that I *despise* phpMyAdmin and do almost all of my database manipulation in the shell. It keeps my brain fresh, especially for correctly and efficiently crafting queries for use in my php apps. If you're a sysadmin, I would recommend spending some more time in the Terminal and getting used to&#8211;and comfortable with&#8211;the shell.


----------



## wicky (Oct 3, 2008)

Thanks for the feedback Michael.

Another question: what are the shell commands to start Apache & MySQL?

*On the subject of despising phpMyAdmin:*
We don't all work the same way! I'm sure over time I'll become increasingly easy with the Terminal, as I have so far by learning as I go along. However, as a designer, I work best visually and phpMyAdmin provides a reasonable interface for me, and seemingly for other people too which is why it was developed in the first place and why it is so widely used.


----------



## michaelsanford (Oct 3, 2008)

wicky,

Surely, some people love it! I was only voicing my _personal opinion_. If you enjoy it, and it does the job for you, then by all means, use it! I'm sure I do things, and use tools, that others find useless (like doing most of my SQL in the Terminal ) I just can't stand mousing or tabbing around in fields, only to have the query fail, leaving me with no command history. As this is my chief concern, using the mysql client tool in the terminal is my perfect solution.

Apache can be started from the Sharing pane (Web Sharing) and MySQL is usually started with "*/usr/bin/mysqld_safe &*" but it would depend somewhat on your particular implementation.

EDIT: Sorry, I forgot that this was in the OS X Server forum. I don't use OS X Server edition, but I imagine a search of Google "start mysql OS X server" would fix that.


----------



## ylbissop (Mar 30, 2009)

wicky said:


> what are the shell commands to start Apache & MySQL?



just so you know you don't have to use shell commands to start stop services in osx server it can all be done with the Server Admin app. once you have server admin connected to your server. Click "help"  type "Apache" or "mysql" or whatever into the search box and click "show all results" it should give you the basic docs you need to get you on your way.


----------



## VirtualDarKness (Mar 31, 2009)

wicky said:


> Another question: what are the shell commands to start Apache & MySQL?



for apache:

```
apachectl [stop|start|restart]
```

for mysql.. I've installed it from mysql so not using the mac os x server pre-installed version and I use:


```
/Library/StartupItems/MySQLCOM/MySQLCOM [stop|start|restart]
```

don't remember if the pre-installed version has something like:

```
/Library/StartupItems/MySQL/MySQL[stop|start|restart]
```


bye,
Giovanni.

p.s.
for phpmyadmin you can also setup a global alias in apache (see the "icons" one in the /etc/httpd/httpd.conf file) 

and you could also install webmin that comes handy for some tasks:
http://www.webmin.com/osx.html


----------

