Skip to content

{ Category Archives } Database

mysql query tracing

# Turn on logging set global log_output=FILE; set global general_log=1; # Turn off logging set global general_log=0; The log file was writing it to mysql/data/{hostname}.log on my machine. I recently used this to discover why a Rails app was taking 15 seconds to load a page.  I know this is also shown in the Rails [...]

MacPorts mysql with GUI tools

A friend had some problems installing MySql with MacPorts and asked me if I had problems installing it.  Our problems were totally unrelated but thinking back, I remembered I had problem with MySQL Query Browser.  I couldn’t get it to connect even though I could connect via the command line.  It turned out to just [...]

Uninstall MySQL on Mac

Somehow, I either forgot my password, or I did something to mess up my MySQL instance.  it is a development machine, so I don’t really care about the databases on it.  I just wanted to remove it completely from my machine.  I actually had two copies of mysql installed.  One from Mac Ports and the [...]

Determine mysql socket

netstat -ln | grep mysql

Install MySql5 on Snow Leopard using MacPorts

Install MacPorts before you do anything. Install MySQL5 sudo port install mysql5 sudo port install mysql5-server  sudo -u mysql mysql_install_db5 Secure MySQL5 To secure your MySQL5 installation, you can either change the password manually like so: /opt/local/lib/mysql5/bin/mysqladmin -u root password {new-password} or on a production system, you can run the secure script and not only [...]

Login failed after restoring database on SQL Server 2008

After restoring a production database backup on SQL Server 2008, to my development machine, I got a “Login failed for user xyz”. The database user was not associated with a user and was marked as “Without login”. This happens when you do not have a login for the database user.  You can create that user [...]