资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

MySQL5.5.32编译安装

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、编译环境准备
# 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
 
# sed -i 's/datadir=\/var\/lib\/mysql/datadir=\/usr\/local\/mysql\/data/g' /etc/my.cnf  
# sed -i 's/socket=\/var\/lib\/mysql\/mysql.sock/socket=\/usr\/local\/mysql\/tmp\/mysql.sock/g' /etc/my.cnf  
 
# 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";

分享名称:MySQL5.5.32编译安装
网站链接:http://cdkjz.cn/article/ijdcse.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220