My 4 Questions For Mysql And Php On Mac?
Sunday, November 22nd, 2009 at
7:46 am
Im a newbie
1) How do you create a username and password for mysql on a mac?
2) Do you need a web host in order to use mysql?
3) What does apache do?
4) What does phpmyadmin do for mysql?
Tagged with: Mysql • Questions
Filed under: Questions & Answers
Like this post? Subscribe to my RSS feed and get loads more!


Depends on what you mean by creating a user, in mysql, I generally just grant access to someone on a particular database.
I typically use a variation of:
mysql>GRANT ALL PRIVILEGES ON database.* TO user@host.example.com IDENTIFIED BY ‘password’;
mysql>FLUSH PRIVILEGES;
In the above case, replace “database” with whatever your database is. ISP’s generally offer tools for this sort of thing, but, this is generally how I do it when I work with mysql.
Do read up on it, it’s easy to goof up and allow everyone access by mistake.
You should also look into postgresql, not as popular for the masses, it is, in many ways better than mysql. Postgresql has mature transactions, column constraints, triggers, rules and a lot of features designed to verify the data before it can be entered, mysql is just beginning to support these features, as far as transactions, you have to explicitly ask for them at the time you create the tables. Transactions are important for referential integrity. (they let you “back out” in the middle of something without leaving your tables in a 1/2 crazy state.)
mysql might be better if you have a massive amount of data or want to store it in different formats, mysql has “storage engines”
You don’t need a web host to use mysql (or postgresql for that matter)
Apache, in the context you are using it, is a web server. http://httpd.apache.org/ (they are also a group of programmers who bring us many nice tools)
phpmyadmin is a PHP script for manipulating mysql via a web browser.
I’d recommend you look into the documentation and also check into the other available open source databases, mysql is popular and a good database, but that doesn’t mean it’s the best database for all purposes. I suspect a large reason for its popularity is the relatively low resource consumption and fast connect times appeal to ISP’s. (it is good for that)
postgresql is worth looking into if at all possible.
Read the manuals on these before you get too deep. Apache is a webserver. To use php you run it on that web server. phpmyadmin is a tool to control the data structures of mysql.
To create the initial password you need to log into mysql as the user root, which initially has no password provided you have mysql running on the machine. But before you do, READ the manual.