Mertech Blog

Installing MySQL in Linux CentOS/Red Hat

Written by Mertech | Feb 24, 2008 10:44:00 PM

Installing MySQL in Linux is not a difficult task; here's the step by step guide on how to do it:


In CentOS you might not have perl-DBI installed:

 

yum install perl-DBI

rpm -ivh MySQL-server-XXXXXX.rpm

rpm -ivh MySQL-client-XXXXXX.rpm

rpm -ivh MySQL-devel-XXXXXX.rpm

  • Set root passwords


mysqladmin -u root password 'new-password'

mysqladmin -u root -h <computer name>.<localdomain> password 'new-password' -p


tar xvfz mysql-gui-tools-XXXXXX.tar.gz

rpm -ivh mysql-gui-tools-XXXXXX.rpm

rpm -ivh mysql-administrator-XXXXXX.rpm

rpm -ivh mysql-query-browser-XXXXXX.rpm

  • The administrator tool is started with: mysql-administrator
  • The query browswer tool is started with: mysql-query-browser


  • CentOS should already have a 'mysql' service entry in the 'Service Configuration' app. Make sure it's set to autostart and stop (that its checked-marked).


  • To add users to a MySQL DB that can access the server remotely use this sql command logged as root:

GRANT ALL PRIVILEGES ON *.* TO 'mertech'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;