Install MySQL Without Using The Install Script Included in Retain
This section is dedicated to those that refuse to, or can't I suppose, use the install script.
Also, this page is currently under construction. Goal to have it finished is by or before Jan 8, 2015. You may see major revisions over the intervening days.
Contents |
Downloading MySQL
- Go to http://www.mysql.com
- Get MySQL 5.5 or 5.6
Are you a simpleton and/or maybe lazy? You're a person after my own heart. I suppose I can help you a little further:
Installing MySQL
Linux
As of this writing all testing has been done on SLES 10/11, early testing on SLES 12 indicates that it should work (DanielC: I have gotten it to install and run and set up a database but have not run Retain against is yet. 2014/12/19) but can't find any documentation that it's supported properly. There are no install files for SLES 12 as of December 2014. MariaDB, a MySQL variant, has replaced MySQL as the included database management system. This is not supported with Retain (Dec 2014)
Installing the RPM packages.
You remember where you put your files that you downloaded right?
Simple command to install any rpm:
- server: # rpm -ivh MySQL-server-5.5.41-1.sles11.x86_64.rpm
You'll need to install both the server and the client rpm packages. Doesn't matter which order you do them in as long as you get both installed.
The rpm install scripts will give you some helpful information, pay attention. It is recommended to run the "Secure installation" script to clean out the test database and user, this will help your system be more secure. This is found in /usr/bin/mysql_secure_installation in both 5.5 and 5.6 installations.
MySQL 5.5 installs with the root user being a blank password. The 5.6 installation will create a random password and will be mentioned (output to the screen in more "technical" terms) during the RPM install of the MySQL server.
Modifying the installation
This would be the best time to put in your own settings for MySQL and the my.cnf file in /etc/
- For 5.5 Copy it from /usr/share/doc/packages/MySQL-server/
- For 5.6 Copy from /usr/
The installer bundled with Retain uses the my-large.cnf file and modifies the path locations. Use whatever file you feel best fits the server environment. However, the 5.6 installation does not have these packaged with it so you may have to modify some of the settings as you see fit. The my.cnf file in /usr is primarily a blank. Recommended reading in the Helpful links section.
If you want to do a data directory other than the default /var/lib/mysql/ Add the line:
datadir=/path/to/where/you/want/the/MySQL/data
Couple of notes about adding this path:
- Do not put a trailing / on it, you don't need it. I.E. what not to do: datadir=/path/destination/
- The installer places this under the line "[mysqld]" for continuity sake please keep it there if you're modifying this line.
- If you change it from the default /var/lib/mysql make sure you've created the directory you're placing it in and make sure the permissions are mysql:mysql
- Experience also says that before you start MySQL for the first time you'll want to copy the /var/lib/mysql directory to the destination path you've chosen. There are some of those default files that were created during the install that will need to be there. Laziness dictates that you copy the whole thing, You could probably get away with copying just; ibdata1, the mysql directory, and performance_schema directory. If you're changing the innodb_buffer_pool_size you'll definitely want to skip copying the ib_logfile* files (both 0 and 1) as they'll automatically be re-created upon startup with the size you designate.
Here's an example File:My.cnf.doc This example file is a 5.5 .cnf file and is adapted for use on a 4-6 GB of RAM server also running Retain. probably safer with 5-6 GB of RAM.
Before MySQL has been started now would also be the time to add the line (if it's not already there)
- innodb_file_per_table
Note: MySQL 5.6 turns this on by default so you shouldn't have to put it in. However it won't hurt anything if you add it to your my.cnf file.
There are various other tweaks that can be applied that would probably be easiest done at this time also.
- Memory tuning
Helpful links
There is a LOT of information on the MySQL sites. These should help you find what you want to know. The links are for 5.5 but there is a link on the left side of the page that will send you over to the corresponding article that you're in for 5.6 if you just click on "MySQL 5.6 Manual":