MySQL Version Installs January 8 - 9, 2011 by CW Cyrix -CUSTOM NOTES- 1. basedir is /usr/local/mysql (symlink). 2. datadir is /usr/amisaph/mysql/data. 3. --user=mysql screwed up my permissions. :/ I used my own username, ami-sapphire, instead on my datadir by using chown -R on it. 4. The ones at the MySQL team never changed skip-locking in my-*.cnf files. Change this to skip-external-locking and either leave it on or turn it off in your own my.cnf. -FOLLOWING THE GUIDE BELOW- i. It is. ii. True. iii. That's the point. *insert tl;dr rambling here* --- iv. Yes. v. Yes. vi. No. --- 1. Already downloaded. 2. Stored on my USB stick and extracted to its destination within the terminal on a system with a GUI. Do that as sudo. Revoke sudo permissions and assign them to you. 3. Makes it easier to upgrade to a later version. But still, back up your database if you are upgrading to a major release, e.g., from MySQL 5.1 to 5.5 or 6.0. 4. See Custom Note 3. 5. Do that as sudo. I used my-medium in my example, though. 6. Same as previous. 7. Noted. 8. Noted. 9. Noted. 10. Noted. 11. Noted, but never did it. Had no need to. --- Ep. Had to run mysql-upgrade. It gave errors about mysql.plugin not found. -*- from 'http://en.kioskea.net/faq/4269-installation-migration-mysql-5-1-with-the- official-binaries' : [Installation/Migration] MySQL 5.1 with the official binaries [slightly fixed version by CW Cyrix] Many persons prefer to install MySQL from the binaries compiled with MySQL, rather than using packages (rpm, apt, ...): As * Installing the packages in directories of your choice, it's quite difficult * It depends on the frequency of updating those packages: Unable to test a new version * Sometimes you want to install multiple versions and switch easily from one to another, but when an update is available and that you install it, how can it go, how will you revert the changes in case of problems The alternatives are: - compiling the source code, is sometimes complicated and the result could reveal to be less performant that using the orignal source code of MySQL... - use binaries compiled by MySQL (the topic that we shall discuss below). Note that this manipulation will take less than 15 minutes, and gives you a fresh installation of MySQL Note: The following steps can make a clean install, if you want to migrate, just skip the setup steps, setting up data files, ... Assume that: * Installation will be in/usr/local * You have sufficient rights on the server * The Unix user will be "mysql" (existing account) Steps Retrieve binary mysql * 1) Retrieve binary mysql: here we take an Intel 64bit Linux server Cd/usr/local / > Wget http://mirrors.ircam.fr/... Decompression * 2) Decompression: o tar zxvf /usr/local/mysql-5.1.39-linux-x86_64-glibc23.tar.gz o This creates the directory o > /usr/local/mysql-5.1.39-linux-x86_64-glibc2 Creating symlink mysql * 3) Creating symlink mysql: it suffices to repeat this step for change at a version update (upgrade) for example. o ln -s mysql-5.1.39-linux-x86_64-glibc23/ mysql Rights Assignment: * 4) Rights Assignment: o cd /usr/local/mysql o chown -R mysql o chgrp -R mysql Implementation of the configuration file * 5) Implementation of the configuration file in /etc/my.cnf: Many examples are provided with the binaries, just pick one. Here, we take the "mysql-huge" which is suitable for machines with 4GB RAM o cp support-files/my-huge.cnf /etc/my.cnf Configuration * 6) Your Configuration: Edit the file the: /etc/my.cnf, and decide at least the directory that contains your data (datadir): By default, it is > /usr/local/mysql/data/ o [mysqld] o user = mysql o basedir = /usr/local/mysql o datadir = /mon/repertoire/mysql * 7) Set up the init.d script that will stop/relaunch Mysql (start, stop, restart, ...) o > cp support-files/mysql.server /etc/init.d/mysql o Then as a precaution to edit this file to the correct datadir (datadir =...) * 8) Set the minimum data: o > scripts/mysql_install_db --datadir=(same as above) --user=mysql This will create the directory, install the system tables, ... Getting started * 9) Start mysql: o > /etc/init.d/mysql start * 10) Best Practice: immediately assign the root user password! (it is empty by default) o > ./bin/mysqladmin -u root password "password" o The INSTALL-BINARY explains you all this, with variations, but the goal is the same ... * 11)Tools like (mysql client, mysqldump, ...) are located in the directory /usr/local/mysql/bin :: to be able to call from anywhere, you can either add this directory to your PATH (file ~/.bashrc) create symlinks in /usr/bin/ * o Finally, if you are migrating from 5.0 to Mysql 5.1, the script bin/mysql-upgrade will allow you to update the system tables (INFORMATION_SCHEMA, ...)