Filed under: mac
Just learned this cool tip for Mac users (thanks Mike O.!) So when you’re working unplugged and really want to optimize battery usage, you can invert the colors on your screen. Just push ctrl-option-propeller-8 and whalla! and inverted screen. So why is this so cool. Well think of it this way: Every non-black pixel requires power to illuminate it. If you use Eclipse, then most likely you are seeing lots of white. By inverting the color scheme, you have greatly reduced the number of white pixels showing, and in theory is using less power. Also the inversion of colors makes it easier to read in low-light situations.
The only issue that have is that it makes it very hard to find your cursor when over a large text input contol. But I am sure there is a simple fix to that too.
Cool find no?
[UPDATE]
It appears that a 10.5 friendly version of mysql has been released. Before engaging in this tutorial you might want to check with a more traditional install procedure that comes with the newest version of mysql.
======================
Firstly, I should preface this post by saying that there are probably at least a dozen posts on this topic. All are basically the same with little differences here and there. None of them worked for me. But what did work (so far) is taking bits and pieces from a post here and a post there to finally get something working. Thanks goes out to all those other bloggers who provided the information found here.
Additionally, if things keep going the way they had been, this might not work at all. I have had MySQL up and running several times only to return to find it no longer wants to start for me.
Keep in mind that this is my attempt at a new install of MySQL on my newly acquired MacBook Pro (MBP hereinafter).
Step 1: Enable your root user
- Open the Directory Utility: In the Finder, navigate to the Utilities folder (tip: click on the desktop, hit Cmd+Shift+U).
- Click on the padlock to allow edits.
- Go Edit > Enable Root User
- Enter and re-enter your password.
Now, you are set to access protected areas of the system via the terminal.
[Excerpt from StringFoo's post]
Step 2: Backup any existing databases from previous versions of MySQL
I never had anything installed so I never attempted to do so. But this goes without saying for you other folks.
Step 3: Remove previous versions of MySQL
I did attempt multiple installs so I did remove them prior to my finally working install. I had nothing to preserve so again, if you are looking to backup a previous version you might want to research it.
- Open a new Terminal window.
- Remove the installed location by typing
sudo rm -rf /usr/local/mysql(keep in mind that if you backed up your databases in this directory it is targeted to get deleted!!!). What this basically says (for all of we new Mac users is: super user remove the targeted folder and recursively do so to any subsequent folders and files from this location. - Remove any launchers by typing
sudo rm -rf /Library/StartupItems/MySQLCOM/
[Excerpt from Hivelogic's post]
Step 4: Add environment variables and some Terminal alias to launch MySQL
- Open a Terminal window.
- Use a command-line text editor to create the enviro-vars and aliases by typing
pico ~/.bash_login(that is a tilde not a dash btw). This opens the pico text editor and either opens or creates the .bash_login hidden file at your user’s folder. - Add the following text:
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
alias mysql-start="sudo /usr/local/mysql/support-files/mysql.server start"
alias mysql-stop="sudo /usr/local/mysql/support-files/mysql.server stop" - type ctrl-x to initiate closing Pico.
- type y to save it.
- type enter to save to the prompted location
- You should now be back in Bash
- Now get Teminal to load those new aliases and path type:
. ~/.bash_login
Step 5: Grab the MySQL installer and install
- Grab the appropriate installer from the MySQL download page (I am using the intel based MBP)
- Install to the default locations.
- I went ahead and installed the System Preferences utility that is supposed to help you start/stop MySQL’s server, however it did not work. Do so if you wish and maybe you can get it to work. Here are some comments on how you might get it going
Step 6: Update ownership of some launch-specific files
- In a terminal window, type the following in order to create a folder where the MySQL sock file will live.
- Create the folder:
sudo mkdir /var/mysqlThis just says super user make directory mysql in the var directory - Change ownership of that directory to the user _mysql:
sudo chown _mysql /var/mysql
[Excerpt from StringFoo's post]
Step 7: Start the MySQL server and then login
Hopefully, if I remember all the steps I took to get this working and it actually works for you, then you should be able start the MySQL server and login.
- Type
mysql-start - If all is well you should see a succsss message. So now login by typing:
mysql -u rootThis just means login to the MySQL server as the user root - If that works then you should see a prompt saying
mysql> - If you want to stop the MySQL server, exit the current user by typing:
exit - You should now be back in the terminal so type:
mysql-stopYou should then see another Success message saying that you stopped the server
That’s it. Again, I should really thank the community out there for providing various approaches to getting this thing up and running on Leopard. If you are like me, a new Mac user, then hopefully this will get you working with MySQL. Keep checking the web for a Leopard supported installer so then we can make use of the System Preferences MySQL launcher.
[UPDATE #2]
Thanks to the readers’ comments I got it working. Yippee!!! I just did an OS software update going from OS 10.5 => 10.5.1. I did uninstall the flash player and then reinstalled it but that may be entirely unnecessary as the OS update may completely address the fix for the older flash player versions. That is my assumption.
[UPDATE]
My buddy just sent me a link to folks reporting this issue all over the place. So the code wasn’t an issue, the OS is. Adobe has released n update to the mac version of the Flash player:
[ORIGINAL POST]
I wanted to throw this out there. I have been trying to get a LocalFileUtil class to work for a day or so with no luck whatsoever. I have given the code to another developer running a Mac with OS 10.4.10 and was tested in both Firefox and Safari. It works as expected. So why no go for me?Basically what is happening is this: I have created a simple example application that should only trigger either the Event.SELECT or Event.CANCEL handlers. Regardless if I actually select or cancel, the Event.CANCEL handler is triggered. When inspecting this in the debugger, I find that there are some issues introspecting the fileReference var. Specifically when looking at the event.target (which happens to be the fileReference) I cannot view the properties. Instead of saying actual properties it says, “<exception thrown by getter>”. Looking into that further I find the following exception, “Error: Error #2037: Functions called in incorrect sequence, or earlier call was unsuccessful”. Now this is the same kind of exception that is triggered when using one-time use classes such as an instance of Sound. Sound is the type of class that can only be used once. Even if none of the parameters change, you cannot use that same instance. Its a throw away. Anyway, I have no clue as to what the issue is. Any input is much appreciated. Below is the sample code and a screen shot.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
layout="vertical"
xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
public var fr:FileReference
public function onClick ():void
{
fr = new FileReference();
fr.addEventListener(Event.SELECT, onSelect, false);
fr.addEventListener(Event.CANCEL, onCancel, false);
fr.browse([new FileFilter("images", "*.png;*.jpg;*.gif")]);
}
public function onSelect (evt:Event):void
{
}
public function onCancel (evt:Event):void
{
}
]]>
</mx:Script>
<mx:Button label="test" click="onClick()"/>
</mx:Application>
Since coming on board the mac band wagon, I have run into some brick walls (or rather large columns that take time to circumvent). These are mostly cases where simple scenarios in a Windows environment translate rather poorly in a Mac environment. I think I can truly appreciate the multi-lingual now.
With all the abundant information (and misinformation) out on the web I figured I would compile a quick list of things that I found helpful. Here are some thing I have run into and found simple solutions for:
- Installing mySQL on Leopard – This was originally posted on Stringfoo’s dev blog. His article is specifically tailored to getting PHP and mySQL up and running on Leopard. I only cared to get mySQL running so I stripped it to the bare essentials. This is assuming you have your root password and XCode installed on you system.
- grab the installer. I grabbed the package download for Mac OS 10.4 x86
- only install the main installer, not the startup package as Leopard has issues with the control panel
- open a Terminal window and start mySQL manuall by typing “sudo /usr/local/mysql/support-files/mysql.server start”
- you can stop it by typing “sudo /usr/local/mysql/support-files/mysql.server stop” (like you didn’t know that).
- simple Linux Bash Commands - I am barely functional in DOS so learning Bash was a double whammy. Thankfully a buddy sent me a link to this helpful list of simple commands.
- show/hide hidden files in Finder – open a Terminal window and enter this to show them (or FALSE at the end of the string to hide them again).
- defaults write com.apple.finder AppleShowAllFiles TRUE
- killall Finder
Keep in mind that by enabling this hidden files to reveal themselves, you will start seeing the annoying .DS_store files everywhere you open a Finder view.
- more coming soon as soon as I figure them out.
As for what may be coming soon (which means I am still trying to figure them out) is listed below. If you know how, shout out at me and I will list it in the above list. Thanks in advance:
- created Terminal shortcuts (aka aliases) to fire off the mysql start/stop commands so that I don’t have to type the full path. Everything I have found doesn’t seem to work in Leopard.
- Finding a Mac equivilant to TortoiseSVN shell that works well with Subclipse. I tried using one that seemed to work independently of subclipse so that it didn’t update the folder SVN icons to indicate something was changed.
Well I hope that this will shave a few minutes or hours off of your hunt to figure these issues out. I will be adding more so stay tuned.

