时间:2021-07-01 10:21:17 帮助过:23人阅读
- <span style="color: #0000ff">mkdir</span> -p /data/mysql
- <span>更改目录权限</span>
- <span style="color: #0000ff">chown</span> -R mysql:mysql /data/mysql/
- <span>解压myslq源码包 进入目录<br></span>
- <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
- cd mysql</span>-<span style="color: #800080">5.5</span>.<span style="color: #800080">38</span>
编译
- /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>
- 编译完成后,安装数据库 <br><br>
- <span style="color: #0000ff">make</span> && <span style="color: #0000ff">make</span> <span style="color: #0000ff">install</span>
初始化数据库
- 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>
- vim /etc/my.cnf
- <span style="color: #000000">#添加mysql服务
- </span><span style="color: #0000ff">cp</span> -f /usr/local/mysql/support-files/mysql.server /etc/init.d/<span style="color: #000000">mysqld
- chkconfig </span>--<span style="color: #000000">add mysqld
- chkconfig mysqld on # 开机启动mysql
- #启动服务
- service mysqld restart
- #做链接
- </span><span style="color: #0000ff">ln</span> -s /usr/local/mysql/bin/mysql /usr/<span style="color: #000000">bin
- </span><span style="color: #0000ff">ln</span> -fs /usr/local/mysql/bin/mysqldump /usr/<span style="color: #000000">bin
- </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>
- <span style="color: #0000ff">ln</span> -s /usr/local/mysql/bin/mysql /usr/local/bin/<span style="color: #000000">mysql
- </span><span style="color: #0000ff">ln</span> -s /usr/local/mysql/bin/mysqlimport /usr/local/bin/<span style="color: #000000">mysqlimport
- </span><span style="color: #0000ff">ln</span> -s /usr/local/mysql/bin/mysqldump /usr/local/bin/<span style="color: #000000">mysqldump
- </span><span style="color: #0000ff">ln</span> -s /usr/local/mysql/bin/mysql_config /usr/local/bin/<span style="color: #000000">mysql_config
- </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