sexta-feira, 30 de setembro de 2011

Installing MySQL 5.5 on CentOS 5x

1. Introduction

I suppose you want to uninstall previous version of MySQL before installing new version 5.5. So, this script does "uninstall previous version", including databases. If you want to save your data to migrate to 5.5 version you *must* backup your database before upgrade.Please read and understand this !!!


2. Uninstalling previous version of MySQL


# service mysqld stop               # stop service MySQL if running ...
# yum -y remove mysql               # ... remove previous version 



3. Installing Packages


# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
# yum --enablerepo=remi,remi-test list mysql mysql-server                # check if avaialbe
# yum --enablerepo=remi,remi-test install mysql mysql-server mysql-devel # install from rmi repos
# yum --enablerepo=remi,remi-test install mysql mysql-server mysql-devel # install from rmi repos


4. Configuring MySQL


    4.1. Configure MySQL to startup with system


# chkconfig --add mysqld    # configure MySQL to ...
# chkconfig mysqld on       # ...  startup with system

  4.2. Configure MySQL security

# mysql_secure_installation # configurar segurança do MySQL
  +-------------------------------------------------------------+
  | Enter current password for root (enter for none): <enter>   |
  | Set root password? [Y/n] Y <enter>                          |
  | New password: mysecret <enter>                              |
  | Re-enter new password: mysecret <enter>                     |
  | Remove anonymous users? [Y/n] Y <enter>                     |
  | Disallow root login remotely? [Y/n] Y <enter>               |
  | Remove test database and access to it? [Y/n] Y <enter>      |
  | Reload privilege tables now? [Y/n] Y <enter>                |
  +-------------------------------------------------------------+


  4.3. Configure some performance parameters

# vim vi /etc/my.cnf  # configure o MySQL
  +- /etc/my.cnf --------------------------+
  |  ## InnoDB                             |
  | innodb-buffer-pool-size        = 128M  |
  | innodb-log-file-size           = 100M  |
  | innodb-log-buffer-size         = 8M    |
  | innodb-file-per-table          = 1     |
  | innodb-open-files              = 300   |
  +----------------------------------------+



  4.4. Restart MySQL Service

# service mysqld restart




5. Install driver PHP x MySQL

# yum -y install php-mysql             # install drivers Php x MySQL



6. References



Nenhum comentário:

Postar um comentário