码迷,mamicode.com
首页 > 数据库 > 详细

Centos6.5 安装 MariaDB-10.0.20-linux-x86_64.tar.gz

时间:2015-07-31 14:46:13      阅读:378      评论:0      收藏:0      [点我收藏+]

标签:

  1. 下载mariadb :https://downloads.mariadb.org/  我选择mariadb-10.0.20-linux-x86_64.tar.gz这个版本
  2. 复制安装文件 /opt 目录下 并解压到当前目录 tar -zxf mariadb-10.0.20-linux-x86_64.tar.gz
  3. 把解压的文件名改为mariadb
  4. groupadd mysql 
  5. useradd -g mysql mysql
  6. cd /opt/mariadb
  7. chown -R mysql:mysql /opt/mariadb/data
  8. 把mariadb/support-files下的my-medium.cnf复制到mariadb目录下,并改为my.cnf
  9. ./scripts/mysql_install_db --defaults-file=./my.cnf                 //初始化数据库
  10. cp support-files/mysql.server /etc/rc.d/init.d/mysqld
  11. chmod +x /etc/rc.d/init.d/mysqld
  12. cp support-files/my-large.cnf /etc/my.cnf 
  13. 修改 /etc/rc.d/init.d/mysqld  
    1. basedir=/opt/mariadb
    2. datadir=/opt/mariadb/data
  14. service mysqld start
  15. 修改环境变量 添加mariadb的bin目录 编辑/etc/profile,添加export PATH=$PATH:/opt/mariadb/bin/
  16. 修改root用户密码 ./bin/mysqladmin -u root password ‘123456‘
  17. 登录mysql ./bin/mysql -u root -p
  18. 设置数据库权限:
    1. MySQL [(none)]> use mysql;  
    2. MySQL [mysql]> update user set host=‘%‘ where user=‘root‘ and host=‘127.0.0.1‘; 
    3. MySQL [mysql]> grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘123456‘ with grant option;  
    4. MySQL [mysql]> flush privileges;

 

 

 

 

Centos6.5 安装 MariaDB-10.0.20-linux-x86_64.tar.gz

标签:

原文地址:http://www.cnblogs.com/xiaoliang-y/p/4691934.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!