MySQL - Installation
Installation
The latest version can be downloaded from http://www.mysql.com/downloads/mysql#downloads
Enter the server’s hostname and IP address in /etc/hosts.
If there are going to be structure such as active and passive databases in the clusters, each servers hostname and IP address need to entered to prevent issues.
127.0.0.1 localhost.localdomain localhost
192.168.56.101 db01.local.domain db01
Installing MySQL from RPM packages
|
1 |
mount -t iso9660 /dev/scd0 /media/cd |
To view the rpm packages’ yum repository on the CD
|
1 2 3 4 5 |
vim /etc/yum.repos.d/rhel.repo[rhel] name=RHEL baseurl=file:///media/cd/Server> enabled=1 gpgcheck=0yum install mysql-server mysql |
Installing from tar.gz packages
|
1 2 3 4 5 6 7 8 9 10 11 |
mkdir -p /mysqlgroupadd mysql useradd -d /mysql -s /bin/bash -g mysql mysql passwd mysql -- password should be unique to this MySQL installation -- a different password to the production environmentcd /mysql tar -xzvf mysql-5.5.28-linux2.6-x86_64.tar.gz ln -s mysql-5.5.28-linux2.6-x86_64 mysql cd mysql chown -R root . chown -R mysql data chgrp -R mysql . |
Arrange the my.cnf file as required and copy to the /etc/ folder.
If there is an existing file from a prior version, copy it: cp /etc/my.cnf /etc/my.cnf_prior
If there is a previous MySQL setup:
|
1 2 |
mv /usr/bin/mysql /usr/bin/mysql.old -- if there is a previous version ln -s /mysql/mysql/bin/mysql /usr/bin/mysql |
|
1 2 3 4 |
cp support-files/mysql.server /etc/init.d/mysql chmod 755 /etc/init.d/mysql chkconfig --add mysql chkconfig --level 345 mysql on |
To commence:
|
1 2 |
/mysql/scripts/mysql_install_db --user=mysql /mysql/bin/mysqld_safe --user=mysql &; |
View the log dumps
|
1 |
tail -f /mysql/mysql/data/db01.local.domain.err |
|
1 2 |
/mysql/mysql/bin/mysqladmin -u root password '**PASSWORD**' /mysql/mysql/bin/mysqladmin -u root -h host_name password '**PASSWORD**' -- IMPORTANT: Don't forget to change the host name |
To check
|
1 |
mysql -uroot -p**PASSWORD** |
Kategori seçin...
