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

MySQL 5.5.32 编译安装

时间:2017-03-24 16:06:09      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:老男孩   color   cccccc   style   

最近在听老男孩老师视频上课,把操作过程做了笔记,方便以后使用。

1、安装环境准备

# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
# yum install cmake -y
# yum install ncurses-devel -y
# useradd -s /sbin/nologin -M mysql

2、编译安装MySQL 5.5.32

# mkdir /usr/local/mysql
# mkdir /software
# cd /software/
# tar -zxvf mysql-5.5.32.tar.gz         #上传文件:mysql-5.5.32.tar.gz 到: /software  目录
# cd mysql-5.5.32
# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql  -DMYSQL_DATADIR=/usr/local/mysql/data  -DMYSQL_UNIX_ADDR=/usr/local/mysql/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_ENGINE=1 -DWITH_FAST_MUTEXES=1 -DWITH_ZLIB=bundled -DENABLED_LOCAL_INFILE=1 -DWITH_READLINE=1 -DWITH_EMBEDDED_SERVER=1 -DWITH_DEBUG=0
# make && make install

 

3、初始化MySQL数据库

# /usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql/  --datadir=/usr/local/mysql/data  --user=mysql                             #初始化数据库

# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld

#====================*****==========================#修改文件:/etc/my.cnf ,因为我的MySQL安装在/usr/local/mysql目录下面 
#[mysqld]
#  datadir = /usr/local/mysql/data
#  socket=/usr/local/mysql/tmp/mysql.sock
#===================================================
# chown -R mysql.mysql /usr/local/mysql

# /etc/init.d/mysqld start                                         #启动数据库服务

# /usr/local/mysql/bin/mysql

# cp /usr/local/mysql/bin/mysql /usr/local/sbin/                   #把mysql客户端程序复制到/usr/local/sbin/目录下面

# /usr/local/mysql/bin/mysqladmin -u root password 123456        #更改root用户密码

#  mysql -uroot -p123456    
    >drop user ""@Lab-Srv-02;     
    >drop user "root"@"::1";    
    >drop user ""@"localhost";

MySQL 5.5.32 编译安装

标签:老男孩   color   cccccc   style   

原文地址:http://tengq.blog.51cto.com/2004324/1910036

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