ezeke 发表于 2018-9-29 13:08:32

mysql-5.6.24源码包编译安装

2015/12/18 22:03:34  
# mkdir -p /usr/local/data/mysql/data
  
# useradd -s /sbin/nologin mysql
  
# chown -R mysql:mysql /usr/local/data/mysql/data
  
# yum install gcc gcc-c++ cmake ncurses-devel bison
  
# tar -zxvf mysql-5.6.24.tar.gz
  
# cd mysql-5.6.24
  
# mkdir /usr/local/mysql
  
# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql/data -DDEFAULT_CHARSET=utf8-DDEFAULT_COLLATION=utf8_general_ci -DMYSQL_UNIX_ADDR=/tmp/mysql.sock-DWITH_MYISAM_STORAGE_ENGINE=1-DENABLE_DOWNLOADS=1
  
# make
  
# make install
  
# chown -R mysql:mysql /usr/local/mysql/
  
# cp -a /root/mysql-5.6.24/support-files/my-default.cnf /etc/my.cnf
  
# cp -a /root/mysql-5.6.24/support-files/mysql.server /etc/init.d/mysqld
  
# chmod a+x /etc/init.d/mysqld
  
# chkconfig --level 345 mysqld on
  
# echo "export PATH=/usr/local/mysql/bin/:$PATH" >> /etc/profile
  
# source /etc/profile
  
# /usr/local/mysql/scripts/mysql_install_db --user=mysql --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/usr/local/data/mysql/data
  
# vi /etc/my.cnf
  
# service mysqld start
  
Starting MySQL... SUCCESS!
  
# /usr/local/mysql/bin/mysqladmin -u root password '123456'
  
# mysql -u root -p
  
Enter password:
  
Welcome to the MySQL monitor.Commands end with ; or \g.
  
Your MySQL connection id is 3
  
Server version: 5.6.24 Source distribution
  

  
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  

  
Oracle is a registered trademark of Oracle Corporation and/or its
  
affiliates. Other names may be trademarks of their respective
  
owners.
  

  
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  

  
mysql> exit
  
Bye


页: [1]
查看完整版本: mysql-5.6.24源码包编译安装