当前位置:Gxlcms > 数据库问题 > mysql安装

mysql安装

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

#!/bin/sh

####安装ncurses-5.9.tar.gz
cd /usr/local/src/
tar -zxvf ncurses-5.9.tar.gz
cd  ncurses-5.9
./configure --with-shared --without-debug --without-ada --enable-overwrite
make #or make test  #测试编译
make install #开始编译安装

####安装cmake-2.8.8.tar.gz
cd /usr/local/src/
tar -zxvf cmake-2.8.8.tar.gz
cd  cmake-2.8.8
./configure
make #or make test  #测试编译
make install #开始编译安装

groupadd mysql
useradd -g mysql mysql mysql -s /bin/false 
mkdir -p /usr/local/data/mysql
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/data/mysql -DSYSCONFDIR=/etc
make
make install
cd /usr/local/mysql
scripts/mysql_install_db --user=mysql

####系统开启自动启动
#vim /root/.bash_profile
#PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/lib
#source  /root/.bash_profile #配置马上生效
cd /usr/local/mysql
./bin/mysqld_safe  --defaults-file=/usr/local/mysql/my.cnf --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data  --user=mysql &

#### GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "root";
#### update user set password=password(‘root‘) where user=‘root‘;

  

mysql安装

标签:ges   local   编译安装   cal   tar   sys   ash   path   efault   

人气教程排行