操作系统
more /etc/centos-release
CentOS release 6.8 (Final)
mysql5.6.44版本获取
https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.44.tar.gz1:依赖包安装
yum list cmake
yum install cmake -y
yum install gcc-c++ -y
yum install readline-devel pcre-devel ncurses-devel bison-devel -y
2:创建目录安装,用户,获取安装包
mkdir /home/setup
cd /home/setup
wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.44.tar.gz
useradd mysql -s /sbin/nologin -M
tar -zxvf mysql-5.6.44.tar.gz
3:编译安装
cd /home/setup/mysql-5.6.44cmake . -DCMAKE_INSTALL_PREFIX=/application/mysql-5.6
-DMYSQL_DATADIR=/data/3306/data
-DMYSQL_UNIX_开发云主机域名ADDR=/data/3306/tmp/mysql.sock
-DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci
-DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii
-DENABLED_LOCAL_INFILE=ON
-DWITH_INNOBASE_STORAGE_ENGINE=1
-DWITH_FEDERATED_STORAGE_ENGINE=1
-DWITH_BLACKHOLE_STORAGE_ENGINE=1
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1
-DWITHOUT_PARTITION_STORAGE_EGINE=1
-DWITH_FAST_MUTEXES=1
-DWITH_ZLIB=bundled
-DENABLED_LOCAL_INFILE=1
-DWITH_READLINE=1
-DWITH_EMBEDDED_SERVER=1
-DWITH_DEBUG=0#DCMAKE_INSTALL_PREFIX MySQL安装的根目录
#DMYSQL_DATADIR 数据存放的目录
#DMYSQL_UNIX_ADDR MySQL的sock文件目录 mysql服务器用于监听的套接字,必需是绝对路径make && make install && cd ..4:安装数据库
cd /application/mysql/scripts/
./mysql_install_db –basedir=/application/mysql/ –datadir=/data/3306/data –user=mysql
中途有2个ok表示安装成功mkdir /data/3306/tmp/
chown -R mysql.mysql /data/3306/tmp/cp /application/mysql/bin/* /usr/local/sbin/cp /application/mysql/support-files/my-default.cnf /etc/my.cnf vim /etc/my.cnf[mysqld] 添加:
datadir=/data/3306/data
default-storage-engine=InnoDB
lower_case_table_names=1
port=33065:启动数据库
cd /application/mysql/bin
./mysqld_safe –defaults-file=/data/3306/data/my.cnf –user=mysql &登录数据库
mysql -uroot -S /data/3306/tmp/mysql.sock6:设置开机自启动
cp support-files/mysql.server /etc/init.d/mysql 相关命令:
service mysql start
停止mysql服务
service mysql stop
重启mysql服务
service mysql restart
添加到开机启动项
chkconfig –add mysql偶尔会遇到如下报错
FATAL ERROR: please install the following Perl modules before executing ./scripts/mysql_install_db:
解决方法
yum-y install autoconf
这篇文章将为大家详细讲解有关什么是DBMS中的死锁,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。在数据库中,死锁是两个或多个线程永远被阻塞(挂起),无限期地等待彼此的的条件来完成,解锁数据资源的情况。在这种情况…
免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。