Patrick Galbraith (capttofu) wrote,
Patrick Galbraith

Do I have a 32-bit or 64-bit MySQL?

I was asked the question last week of how to tell whether a MySQL installation is 64-bit or 32-bit. Often, MySQL is pre-installed or installed via a package and it is forgotten when and how it was installed. I scratched my head for a little while and just run

/usr/sbin/mysqld --verbose --help
/usr/local/mysql/libexec/mysqld Ver 5.1.25-rc-debug for suse-linux-gnu on i686
(Source distribution)

This is somewhat telling and I can tell from having used MySQL that this is 32-bit. However, there's nothing that sticks out like a sore thumb that says one way or the other that is is 64 or 32 bit (ok, maybe "i686" (?))

I was working outside, which seems to be where I become inspired and had a "DUH" moment. The command "file" is the key for this:

32-bit linux:

patg@ishvara:~> file /usr/local/mysql/libexec/mysqld
/usr/local/mysql/libexec/mysqld: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.4, dynamically linked (uses shared libs), for GNU/Linux 2.6.4, not stripped

64-bit linux:

patg@hanuman:~$ file /usr/sbin/mysqld
/usr/sbin/mysqld: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped

OS X: (a little less telling)

patg@radha:~ pgalbraith$ file /usr/local/mysql/libexec/mysqld
/usr/local/mysql/libexec/mysqld: Mach-O executable i386

So, "file" is one way. Any other tips/suggestions/corrections welcomed.
Tags: architecture, mysql
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic