CentOS6.5下安装MariaDB5.5.36

yum groupinstall -y "Development Tools"

yum install -y cmake openssl-devel zlib-devel

yum install -y ncurses-devel

 

groupadd mysql

useradd mysql -g mysql
mkdir -p /usr/local/mysql
mkdir -p /db/mysql/data

mkdir -p /usr/software

chown -R mysql:mysql /usr/local/mysql
chown -R mysql:mysql /db/mysql/data
chown -R mysql:mysql /usr/local/mysql/.
chown -R mysql:mysql /db/mysql/data/.

echo "PATH=/usr/local/mysql/bin:/usr/local/mysql/lib:\$PATH" >> /etc/profile
echo "export PATH" >> /etc/profile

source /etc/profile

cd /usr/software/

 

yum install ntpdate -y

yum install wget -y

ntpdate time.windows.com && hwclock -w

wget http://mirrors.scie.in/mariadb/mariadb-5.5.36/kvm-tarbake-jaunty-x86/mariadb-5.5.36.tar.gz

 

tar -zxvf mariadb-5.5.36.tar.gz


cd /usr/software/mariadb-5.5.36
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_SPHINX_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/db/mysql/data -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306

make && make install

cp /usr/local/mysql/support-files/my-small.cnf /etc/my.cnf
cd /usr/local/mysql
scripts/mysql_install_db --user=mysql --datadir=/db/mysql/data
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql

===============================================================
在 /etc/my.cnf文件下:

[mysqld]
添加如下 lower_case_table_names=1
===============================================================
service mysql start
chkconfig mysql on

mysqladmin -u root password 'dsideal'

service iptables stop
chkconfig iptables off


mysql -uroot -pdsideal

GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "dsideal";
flush privileges;

 

你可能感兴趣的:(centos6)