2、安裝必須的依賴包
yum -y install make gcc-c++ cmake bison-devel ncurses-devel libaio libaio libaio-devel perl-data-dumper net-tools3、解壓並編譯
tar xvf mysql-5.7.17.tar.gz
cd mysql-5.7.17
cmake \ -dcmake_install_prefix=/usr/local/mysql \ -dmysql_datadir=/usr/local/mysql/data \ -dsysconfdir=/etc \ -dwith_myisam_storage_engine=1 \ -dwith_innobase_storage_engine=1 \ -dwith_memory_storage_engine=1 \ -dwith_readline=1 \-dmysql_tcp_port=3306 \ -denabled_local_infile=1 \ -dwith_partition_storage_engine=1 \ -dextra_charsets=all \ -ddefault_charset=utf8 \ -ddefault_collation=utf8_general_ci \ -ddownload_boost=1 -dwith_boost=/usr/local/boost
make
make install
4、建立mysql使用者並給mysql使用者賦予mysql程式安裝目錄的許可權
useradd mysql -s /sbin/nologinchown -r mysql:mysql /usr/local/mysql
mkdir /usr/local/mysql/data
chown -r mysql:mysql /usr/local/mysql/data5、為mysql建立自帶的資料庫和表
cd /usr/local/mysql6、註冊為服務bin/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql
cp support-files/mysql.server /etc/init.d/mysql7、建立etc/my.cnf
cp support-files/my-default.cnf /etc/my.cnf8、將mysql加入環境變數
vi /root/.bash_profile
在path=$path:$home/bin新增引數為:
path=$path:$home/bin:/usr/local/mysql/bin:/usr/local/mysql/lib [root@ rhel5~]#source /root/.bash_profile
9、設定預設密碼
mysql 5.7在安裝後會預設生成乙個隨機密碼存放在/root/.mysql_secret10、啟動mysql檢視改密碼使用
cat /root/.mysql_secret
隨後修改密碼
mysqladmin -u root -p'oldpassword' password 'newpassword'
systemctl start mysql11、設定mysql遠端訪問
mysql -u root -proot12、設定防火牆新增埠grant all privileges on *.* to 'root'@'%' identified by 'youpasswd' with grant option;
flush privileges;
firewall-cmd --zone=public --add-port=3306/tcp --permanent13、設定myqsl開機啟動
chkconfig –-add mysqlchkconfig mysql on
CentOS原始碼安裝PHP
先安裝需要的庫 yum y install libxml2 yum y install libxml2 devel yum y install gd yum y install gd devel yum y install curl curl devel yum y install libjpeg ...
CentOS 原始碼安裝PHP
2 解壓縮並且進入解壓縮後的檔案目錄下 4 make make install 遇到問題 1 configure error xml2 config not found.please check your libxml2 installation 參看 安裝php時的報錯 checking libx...
Centos 原始碼安裝apache
安裝apache前準備 1 檢查該環境中是否已經存在httpd服務的配置檔案,預設儲存路徑 etc httpd httpd.conf 這是centos預裝的apache的乙個ent版本,一般我們安裝源 版的apache 如果已經存在 etc httpd httpd.conf,請先解除安裝或者關閉ce...