viernes, 6 de febrero de 2015

Migración de MySQL 5.5 a 5.6/ Migration from MySQL 5.5 to 5.6


  1. Crear una copia: mysqldump (shell> mysqldump --single-transaction --all-databases > bd_backup_20150115.sql;) o workbrench
    1.  linux: es bueno comenzar con una actualizacion: sudo apt-get update
  2.  detener el servicio de MySQL (consider setting innodb_fast_shutdown to 0 before shutting down, en InnoDB el apagado es mas lento y tendría q estar totalmente apagado)
    1.  windows: NET STOP MySQL | C:\> "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqladmin" -u root shutdown
    2.  linux: 
      • check: sudo service mysql status
      • stop: sudo service mysql stop 
  3. por si la nueva versión da problemas con el arranque:   mantener la anterior con un rename de mysqld (/usr/sbin/mysqld -> /usr/sbin/mysqld-5.5) y hacer una copia de la configuracion actual (my.cnf o my.ini)
  4.  lanzar la actualizacion
    1.  windows: installer
    2. Red Hat: 
      1. copiar el instalador mysql-apt-config_0.3.2-1ubuntu12.04_all.deb (para lanzar el apt-get)
      2.  añadir el fichero anterior al repo: sudo dpkg -i mysql-apt-config_0.3.2-1ubuntu12.04_all.deb
      3. sudo apt-get install mysql-server 
      4. sudo apt-get install libmysqlclient18
    3. CIUDADO!! en mi caso uso el python connector y en la version 2.0.2 daba un error de perdida de conexion y en la 2.0.3 no lo daba pero se quedaba colgado, por lo que he instalado el 1.2.3
  5. Mantener los parametros que han cambiado de valor por defecto para que funcione bien lo que teniamos, poniendo la siguiente configuracion en el fichero:
    1. windows: my.ini en el directorio raiz
    2. linux: my.cnf en el directorio raiz (/etc/mysql/my.cnf)
      1. [mysqld]
        innodb_file_per_table=0
        innodb_checksum_algorithm=INNODB
        binlog_checksum=NONE
  6. Lanzar la comprobación de las tablas y que se actualicen/corrijan si hace falta (shell> mysql_upgrade -u root -p)
  7.  rearrancar el servicio / programa
    1. windows: NET START MySQL / mysqld
    2. linux: sudo service mysql start

____________________________________________


  1. Create a backup: mysqldump (shell> mysqldump --single-transaction --all-databases > bd_backup_20150115.sql;) or workbrench
    1.  linux: it is advisable to update the system: sudo apt-get update
  2. Stop the MySQL service (consider setting innodb_fast_shutdown to 0 before shutting down, in InnoDB the stop action takes more time and it is necessary a complete stop)
    1.  windows: NET STOP MySQL | C:\> "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqladmin" -u root shutdown
    2.  linux: 
    • check: sudo service mysql status
    • stop: sudo service mysql stop 
  3. Safety actions:   keep a copy, with a rename, of mysqld (/usr/sbin/mysqld -> /usr/sbin/mysqld-5.5) an another of the current configuration (my.cnf o my.ini)
  4. Launch the actualization
    1.  windows: installer
    2. Red Hat: 
      1. copy the instaler mysql-apt-config_0.3.2-1ubuntu12.04_all.deb (to launch the apt-get)
      2.  adding the file to the repo: sudo dpkg -i mysql-apt-config_0.3.2-1ubuntu12.04_all.deb
      3. sudo apt-get install mysql-server 
      4. sudo apt-get install libmysqlclient18
    3. CAREFUL!! the python connector version 2.0.2 had a problem with connection and version 2.0.3 does not return the "lost connection error" but is frozen the thread, so I had to install the version 1.2.3
  5. Keeping the value of the paremeters that has change the default value in this version, so the following configuration must be added to configuration file:
    1. windows: my.ini (mysql path or "Program Data" folder)
    2. linux: my.cnf (path /etc/mysql/my.cnf)
      1. [mysqld]
        innodb_file_per_table=0
        innodb_checksum_algorithm=INNODB
        binlog_checksum=NONE
  6. Checking problems and updating tables (shell> mysql_upgrade -u root -p)
  7. Starting the service or program
    1. windows: NET START MySQL / mysqld
    2. linux: sudo service mysql start

Refs:

  • 5.5 to 5.6: http://dev.mysql.com/doc/refman/5.6/en/upgrading-from-previous-series.html
  • APT upgrade: http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/index.html#repo-qg-apt-upgrading
  • windows upgrade: http://dev.mysql.com/doc/refman/5.6/en/windows-upgrading.html

No hay comentarios:

Publicar un comentario