40 用户权限管理及查询缓存索引和explainMariaDB存储引擎及编译安装MySQL中的事务

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了40 用户权限管理及查询缓存索引和explainMariaDB存储引擎及编译安装MySQL中的事务相关的知识,希望对你有一定的参考价值。

03 MariaDB存储引擎及编译安装


CentOS6.x下安装Mariadb

#准备MaridDB存储分区

[[email protected] ~]# fdisk /dev/sda


WARNING: DOS-compatible mode is deprecated. It‘s strongly recommended to

switch off the mode (command ‘c‘) and change display units to

sectors (command ‘u‘).


Command (m for help): n

Command action

  e   extended

  p   primary partition (1-4)

p

Selected partition 4

First cylinder (5509-26108, default 5509): 

Using default value 5509

Last cylinder, +cylinders or +size{K,M,G} (5509-26108, default 26108): +20G


Command (m for help): t

Partition number (1-4): 4

Hex code (type L to list codes): 8e

Changed system type of partition 4 to 8e (Linux LVM)


Command (m for help): w

The partition table has been altered!


Calling ioctl() to re-read partition table.


WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table. The new table will be used at

the next reboot or after you run partprobe(8) or kpartx(8)

Syncing disks.

[[email protected] ~]# partx -a /dev/sda

[[email protected] ~]# pvcreate /dev/sda4

 dev_is_mpath: failed to get device for 8:4

 Physical volume "/dev/sda4" successfully created

[[email protected] ~]# vgcreate myvg /dev/sda4

 Volume group "myvg" successfully created

[[email protected] ~]# lvcreate -L 10G -n mydata myvg

 Logical volume "mydata" created

[[email protected] ~]# mke2fs -t ext4 /dev/myvg/mydata

[[email protected] ~]# mkdir -p /mydata/

[[email protected] ~]# vim /etc/fstab 

添加

/dev/myvg/mydata        /mydata                 ext4    defaults        0 0

[[email protected] ~]# mount -a

[[email protected] ~]# mkdir /mydata/data

[[email protected] ~]# chown mysql.mysql /mydata/data/


[[email protected] ~]# yum groupinstall "Development Tools" "Server Platform Development" -y

[[email protected] ~]# yum -y install cmake

[[email protected] ~]# groupadd -r -g 306 mysql

[[email protected] ~]# useradd -r -g 306 -u 306 mysql

[[email protected] ~]# tar xf mariadb-5.5.53.tar.gz  

[[email protected] ~]# cd mariadb-5.5.53

[[email protected] ~]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mariadb-5.5.53 \

 -DMYSQL_DATADIR=/mydata/data \

 -DSYSCONFDIR=/etc \

 -DWITH_INNOBASE_STORAGE_ENGINE=1 \

 -DWITH_ARCHIVE_STORAGE_ENGINE=1 \

 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \

 -DWITH_READLINE=1 \

 -DWITH_SSL=system \

 -DWITH_ZLIB=system \

 -DWITH_LIBWRAP=0 \

 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock \

 -DDEFAULT_CHARSET=utf8 \

 -DDEFAULT_COLLATION=utf8_general_ci

[[email protected] mariadb-5.5.53]# make

[[email protected] mariadb-5.5.53]# make install

[[email protected] mariadb-5.5.53]# cd /usr/local/mariadb-5.5.53/

[[email protected] mariadb-5.5.53]# chown -R root.mysql ./*

[[email protected] local]# ln -s mariadb-5.5.53/ mysql

[[email protected] local]# cd mysql/

[[email protected] mysql]# scripts/mysql_install_db --user=mysql --datadir=/mydata/data/

[[email protected] mysql]# mkdir /etc/mysql

[[email protected] mysql]# cp support-files/my-large.cnf /etc/mysql/my.cnf

[[email protected] mysql]# vim /etc/mysql/my.cnf 

添加(41之后)

datadir = /mydata/data

innodb_file_per_table = ON

skip_name_resolve = ON

[[email protected] mysql]# cp support-files/mysql.server /etc/rc.d/init.d/mysqld

[[email protected] mysql]# chmod +x /etc/rc.d/init.d/mysqld 

[[email protected] mysql]# chkconfig --add mysqld

[[email protected] mysql]# service mysqld start

[[email protected] mysql]# /usr/local/mysql/bin/mysql





本文出自 “追梦” 博客,请务必保留此出处http://sihua.blog.51cto.com/377227/1867150

以上是关于40 用户权限管理及查询缓存索引和explainMariaDB存储引擎及编译安装MySQL中的事务的主要内容,如果未能解决你的问题,请参考以下文章

MySQL之变量查询缓存和索引

JavaLearn#(17)MySQL基础知识DML及DDL语句外键及非外键约束外键策略DQL语句(单表多表)连接查询子查询索引事务视图存储过程用户权限及角色管理

JavaLearn#(17)MySQL基础知识DML及DDL语句外键及非外键约束外键策略DQL语句(单表多表)连接查询子查询索引事务视图存储过程用户权限及角色管理

项目一:第十三天 1菜单数据管理 2权限数据管理 3角色数据管理 4用户数据管理 5在realm中动态查询用户权限,角色 6Shiro中整合ehcache缓存权限数据

BOS项目 第8天(权限管理添加角色管理添加用户管理添加shiro权限框架使用ecache缓存)

MySQL 权限和查询缓存