rispost Askeet! Diary - Day 2

December 19th, 2005

Time for Tutorial 2

Tutorial 1 took way longer than it should have. Mostly because of my ignorance, and the fact that things are just a bit different on the Mac. But today I just don’t have that much time. I have to be somewhere in an hour. I’m just going to blaze through tutorial 2.

Tools
TextWrangler - this not an absolute necessity, but this text editor is free and comes with a handy command line tool. In the terminal, you can just type $ edit somefile and it opens that file in TextWrangler. Rather handy. You could always use TextEdit, or pico, or your new best friend VIM.

MySQL - Keeping with the spirit of learning, I got version 5.0.14. Get whatever version you like, but be sure to get the Standard paackage.

MySQL Administrator - A nice little companion app to help administer the MySQL database server.

Installation
TextWrangler is a simple drag and drop installation. Throw the application anywhere you like, but /Applications is a perfect place.

MySQL Administrator is also a simple drag and drop installation.

MySQL is distributed as a package with some extras on the disk image. Go head and install the package. I also installed the Preference Pane just to have a quick and easy way to start and stop the server. I didn’t install the StartupItem since I don’t expect to use mysql all the time. I’d rather start and stop it manually for now. I can always add the StartupItem later.

Once MySql is installed, open the MySQL Preference Pane in the System Preferences and start up the server. Now open that MySQL Administrator program. Connect to localhost with user root and no password. Go to the accounts tab. Select the root user, change the password, and click “Save Changes”.

Changes to the tutorial
The tutorial is fine as is. There’s really nothing I needed to differently since I was on a mac. There are two things I would suggest though.

When you create the database$ mysqladmin -u youruser -p create askeet, I would do it as the root user. You know the one you set the password for in the MySQL Administrator earlier. I would then go to the accounts tab of the MySQL Administrator and a user. Call it askeet, and give it a password. Now click Add a host. Make it localhost. Click the triangle next to the askeet account from the list on the left to show the list of hosts. Select localhost. Switch to the “Schema Privileges” tab. Select the askeet database from the “Schemas” list. Select everything from the “Available Privileges” list on the far right, and click on the “<” button. Click “Save Changes”.

Essentially what we’ve done is created a user that only has the ability to make changes to the askeet database. This is a fairly standard security practice.

From now on when making database connections or setting database connections you should use the askeet user and not use root. This goes for the database connection info in the orm.yml file, and when you propagate the MySQL database with the generated schema in $ mysql -u youruser -p askeet < data/sql/schema.sql.

The other suggestion is a small simple one. Don’t forget to commit your changes to subversion: $ svn commit -m "Day 2 completed".

That’s all for today. This should take you about an hour. I’m sure we’re done with most of the Mac specific stuff. From now on we’ll be able to really learn and focus on symfony.

No Comments »

No comments yet.

RSS feed for comments on this post.

Leave a comment