当前位置:Gxlcms > 数据库问题 > mysql5.5编译安装

mysql5.5编译安装

时间:2021-07-01 10:21:17 帮助过:23人阅读


  1. <span style="color: #0000ff">mkdir</span> -p /data/mysql
  1. <span>更改目录权限</span>
  1. <span style="color: #0000ff">chown</span> -R mysql:mysql /data/mysql/

 

  1. <span>解压myslq源码包 进入目录<br></span>
  1. <span style="color: #0000ff">tar</span> -xzvf mysql-<span style="color: #800080">5.5</span>.<span style="color: #800080">38</span>.<span style="color: #0000ff">tar</span><span style="color: #000000">.gz
  2. cd mysql</span>-<span style="color: #800080">5.5</span>.<span style="color: #800080">38</span>

编译

  1. /usr/bin/cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql/<span style="color: #000000"> </span>-DMYSQL_UNIX_ADDR=/tmp/<span style="color: #000000">mysql.sock </span>-DMYSQL_UNIX_ADDR=/data/mysql/<span style="color: #000000">mysql.sock </span>-DSYSCONFDIR=/<span style="color: #000000">etc </span>-DMYSQL_USER=<span style="color: #000000">mysql </span>-DMYSQL_TCP_PORT=<span style="color: #800080">3306</span><span style="color: #000000"> </span>-DWITH_XTRADB_STORAGE_ENGINE=<span style="color: #800080">1</span><span style="color: #000000"> </span>-DWITH_INNOBASE_STORAGE_ENGINE=<span style="color: #800080">1</span><span style="color: #000000"> </span>-DWITH_PARTITION_STORAGE_ENGINE=<span style="color: #800080">1</span><span style="color: #000000"> </span>-DWITH_BLACKHOLE_STORAGE_ENGINE=<span style="color: #800080">1</span><span style="color: #000000"> </span>-DWITH_MYISAM_STORAGE_ENGINE=<span style="color: #800080">1</span><span style="color: #000000"> </span>-DWITH_READLINE=<span style="color: #800080">1</span><span style="color: #000000"> </span>-DENABLED_LOCAL_INFILE=<span style="color: #800080">1</span><span style="color: #000000"> </span>-DWITH_EXTRA_CHARSETS=<span style="color: #800080">1</span><span style="color: #000000"> </span>-DDEFAULT_CHARSET=<span style="color: #000000">utf8 </span>-DDEFAULT_COLLATION=<span style="color: #000000">utf8_general_ci </span>-DEXTRA_CHARSETS=<span style="color: #000000">all </span>-DWITH_BIG_TABLES=<span style="color: #800080">1</span><span style="color: #000000"> </span>-DWITH_DEBUG=<span style="color: #800080">0</span>

 

  1. 编译完成后,安装数据库 <br><br>
  1. <span style="color: #0000ff">make</span> && <span style="color: #0000ff">make</span> <span style="color: #0000ff">install</span>

 初始化数据库

  1. mv /etc/my.cnf /etc/my.cnf.bak<br>cp /usr/local/mysql/support-files/my-medium.cnf  /etc/my.cnf<br>/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/data/mysql/ --defaults-<span style="color: #0000ff">file</span>=/etc/my.cnf<br><br>
  1. vim /etc/my.cnf

  技术分享

 

 

  1. <span style="color: #000000">#添加mysql服务
  2. </span><span style="color: #0000ff">cp</span> -f /usr/local/mysql/support-files/mysql.server /etc/init.d/<span style="color: #000000">mysqld
  3. chkconfig </span>--<span style="color: #000000">add mysqld
  4. chkconfig mysqld on # 开机启动mysql
  5. #启动服务
  6. service mysqld restart
  7. #做链接
  8. </span><span style="color: #0000ff">ln</span> -s /usr/local/mysql/bin/mysql /usr/<span style="color: #000000">bin
  9. </span><span style="color: #0000ff">ln</span> -fs /usr/local/mysql/bin/mysqldump /usr/<span style="color: #000000">bin
  10. </span><span style="color: #0000ff">ln</span> -s /usr/local/mysql/lib/libmysqlclient.so.<span style="color: #800080">18</span> /usr/lib64/libmysqlclient.so.<span style="color: #800080">18</span>
  11. <span style="color: #0000ff">ln</span> -s /usr/local/mysql/bin/mysql /usr/local/bin/<span style="color: #000000">mysql
  12. </span><span style="color: #0000ff">ln</span> -s /usr/local/mysql/bin/mysqlimport /usr/local/bin/<span style="color: #000000">mysqlimport
  13. </span><span style="color: #0000ff">ln</span> -s /usr/local/mysql/bin/mysqldump /usr/local/bin/<span style="color: #000000">mysqldump
  14. </span><span style="color: #0000ff">ln</span> -s /usr/local/mysql/bin/mysql_config /usr/local/bin/<span style="color: #000000">mysql_config
  15. </span><span style="color: #0000ff">ln</span> -s /usr/local/mysql/include<span style="color: #008000">/*</span><span style="color: #008000"> /usr/local/include/</span>

 

mysql5.5编译安装

标签:curses   权限   ora   ++   useradd   ase   技术分享   color   logs   

人气教程排行