Difference between revisions of "Mysql 5.6"

From VoIPmonitor.org
Jump to navigation Jump to search
Line 16: Line 16:
 
  #Reload privilege tables now? Yes
 
  #Reload privilege tables now? Yes
  
You can test that your mysql is running. Don't forget to set in /etc/mysql/my.cnf in [mysqld] section:
+
You can test that your mysql is running.
 +
Don't forget to set in /etc/mysql/my.cnf in [mysqld] section options for best performance as discused in scalling section of manual([[https://www.voipmonitor.org/doc/Scaling#MySQL_performance]]:
 
  innodb_flush_log_at_trx_commit = 2  
 
  innodb_flush_log_at_trx_commit = 2  
 
  innodb_file_format = barracuda
 
  innodb_file_format = barracuda
Line 23: Line 24:
 
Size for innodb buffer is basicaly half of your available RAM if you have 16G or more but respect your free RAM:(for 2G set 256M, 4G set 512M, 6G set 2G, 8G set 3G)
 
Size for innodb buffer is basicaly half of your available RAM if you have 16G or more but respect your free RAM:(for 2G set 256M, 4G set 512M, 6G set 2G, 8G set 3G)
 
/etc/init.d/mysql restart
 
/etc/init.d/mysql restart
 
  
 
= Debian 7 =
 
= Debian 7 =

Revision as of 13:27, 16 July 2015

Debian 8

Firstly install mysql 5.6 repositor from mysql community:

mkdir /usr/src/mysql
cd /usr/src/mysql
wget https://dev.mysql.com/get/mysql-apt-config_0.3.6-1debian8_all.deb
dpkg -i  mysql-apt-config_0.3.6-1debian8_all.deb

When asked for products (select server -> mysql-5.6 ->Apply)

apt-get update
apt-get install mysql community server

When asked for root password leave it blank for now

mysql_secure_installation
#Remove anonymous users? Yes
#Disallow root login remotely?Yes
#Remove test database and access to it? Yes
#Reload privilege tables now? Yes

You can test that your mysql is running. Don't forget to set in /etc/mysql/my.cnf in [mysqld] section options for best performance as discused in scalling section of manual([[1]]:

innodb_flush_log_at_trx_commit = 2 
innodb_file_format = barracuda
innodb_buffer_pool_size = 8GB

Size for innodb buffer is basicaly half of your available RAM if you have 16G or more but respect your free RAM:(for 2G set 256M, 4G set 512M, 6G set 2G, 8G set 3G) /etc/init.d/mysql restart

Debian 7

apt-get install libaio1
wget "http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-server_5.6.22-1debian7_amd64.deb-bundle.tar"
tar xf mysql-server_5.6*-1debian7_amd64.deb-bundle.tar 
dpkg -i mysql-*.deb

Debian 6

cd /usr/src
wget http://www.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22-debian6.0-x86_64.deb/from/http://cdn.mysql.com/ -O mysql-5.6.22-debian6.0-x86_64.deb
dpkg -i mysql-5.6.22-debian6.0-x86_64.deb
rm mysql-5.6.22-debian6.0-x86_64.deb
mv /etc/mysql/my.cnf /etc/my.cnf
cp /opt/mysql/server-5.6/support-files/mysql.server /etc/init.d/mysql.server && update-rc.d mysql.server defaults
apt-get install libaio1
chown -R mysql /opt/mysql/server-5.6/
chgrp -R mysql /opt/mysql/server-5.6/

upgrade mysql

/opt/mysql/server-5.6/scripts/mysql_install_db --user=mysql --datadir=/var/lib/mysql
rm /opt/mysql/server-5.6/my.cnf 
vi /etc/my.cnf
basedir = /opt/mysql/server-5.6
lc-messages-dir = /opt/mysql/server-5.6/share
remove language = …

Centos 7,6,5 by YUM repos

FRESH install (removes/backups previous data)

Stop voipmonitor service

/etc/init.d/voipmonitor stop

Copy link to mysql-community-repository for RH7,RH6 or RH5 from here (i.e.: if you have centos 6.6 copy link for RH6)

http://dev.mysql.com/downloads/repo/yum/

and download and install:

mkdir /usr/src/mysql
cd /usr/src/mysql
wget http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
yum localinstall mysql-community-release-el6-5.noarch.rpm

Backup previous data of mysql and install new mysql:

service mysqld stop
mv /var/lib/mysql /var/lib/mysql-old
yum install mysql-community-server

Create new system tables and database for mysql and set ownership

mysql_install_db
chown mysql:mysql -R /var/lib/mysql

Start mysql and setup root password (remove anonymous user and test db)

service mysqld start
mysql_secure_installation

Start voipmonitor service (this will create tables neeeded by service in mysql)

/etc/init.d/voipmonitor start

After startup of a service please login to GUI and setup root password/users. (don't forget to setup mysql server for performance as descibed here:Link title

Centos 5

Remove old mysql server and install packages needed for upgrade

yum install libaio perl
yum remove mysql-server mysql

Install mysql-community repository

wget http://dev.mysql.com/get/mysql-community-release-el5-5.noarch.rpm
rpm -Uvh mysql-community-release-el5-5.noarch.rpm

Check for successfully added repository and install new mysql-server

yum repolist enabled | grep "mysql.*-community.*"
yum install mysql-community-server

Recreating/upgrading tables engine, first manualy run mysql-server and after successfully upgrade set ownership of /var/lib/mysql back to mysql

mysqld_safe --skip-grant-tables --skip-secure-auth --skip-networking
mysql_upgrade -p
chmod -R mysql:mysql /var/lib/mysql

Mysql start/check/stop service

service mysqld start
service mysqld status
service mysqld stop

how to yum ref: http://dev.mysql.com/doc/mysql-repo-excerpt/5.6/en/linux-installation-yum-repo.html