時(shí)間:2015/6/28來源:IT貓撲網(wǎng)作者:網(wǎng)管聯(lián)盟我要評(píng)論(0)
對(duì)大家推薦很好使用的Linux mysql系統(tǒng),像讓大家對(duì)Linux mysql系統(tǒng)有所了解,然后對(duì)Linux mysql系統(tǒng)全面講解介紹,希望對(duì)大家有用今天特意配置了mysql Apache php ,雖然網(wǎng)上很多這方面的例子,但是很多是作者再回憶寫的,所以難免有筆誤的地方。而這些東西,正是新手很困惑的地方。一下是我的安裝筆記,在centos虛擬機(jī)上安裝成功。中文的參考:https://xieyu.blog.51cto.com/213338/59749英文的參考 How to Install MySQL 5.0 on Linux,How to Install PHP 5 on Linux ,How to Install Apache 2 on Linux
Linux mysqlapache php 安裝過程。將apache ,mysql ,php 的tar.gz 文件復(fù)制到/home/tmp目錄。接著執(zhí)行下面的命令
Linux mysql 安裝
cd /home/tmp
groupadd mysql
useradd -g mysql mysql
tar -zxvf mysql-5.1.33.tar.gz
cd mysql-5.1.33
./configure --prefix=/usr/local/mysql
make
make install
cd /usr/local/mysql
chown -R root .
bin/mysql -u root -p
chgrp -R mysql .(注意有個(gè).)
cd /home/tmp
cd mysql-5.1.33
ln -s /usr/local/mysql/ /usr/local/mysql
cp support-files/my-small.cnf /etc/my.cnf
修改my.cnf 在[sqld]下面添加user=mysql.
chown root /etc/my.cnf
chgrp root /ect/my.cnf
chmod 644 /etc/my.cnf
/usr/local/mysql/bin/mysqld_safe --user=mysql &
cp support-files/mysql.server /etc/init.d/mysql
chmod 755 /etc/init.d/mysql
chkconfig --add mysql
chkconfig --level 35 mysql on
/usr/local/mysql/bin/mysql_install_db --user=mysql
/usr/local/mysql/bin/mysql -u root(如果能進(jìn)入mysql 命令行,說明mysql 配置成功。)
edit /etc/my.cnf
[client] + default-character-set=utf8 [mysqld] + default-character-set=utf8 [mysql] + default-character-set=utf8
apache安裝,請(qǐng)先進(jìn)入/home/tmp目錄(cd /home/tmp)
tar -zxvf httpd-2.2.13.tar.gz
cd httpd-2.2.13./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite --enable-auth-digest=shared --enable-ssl --enable-deflate
make
history
make install
cp /usr/local/apache2/bin/apachectl /etc/init.d
chmod 755 /etc/init.d/apachectl
/usr/local/apache2/bin/apachectl start
php的安裝
cd /home/tmp
tar -xzf php-5.3.0.tar.gz
cd php-5.3.0
./configure --prefix=/usr/local/php \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-pdo-mysql \
--with-zlib \
--with-libxml-dir \
--with-xsl \
--enable-mbstring \
--enable-zend-multibyte \
--enable-sockets \
--enable-soap \
--enable-zip
Linux mysql
make install修改apache httpd.conf(apache/conf/httpd.conf)添加如下部分:LoadModule php5_module modules/libphp5.so AddType application/x-httpd-php .php
cp php.ini-development /usr/local/php/lib/php.ini
/usr/local/apache2/bin/apachectl start
/usr/local/apache2/bin/apachectl stop
/usr/local/apache2/bin/apachectl start
附:Linux mysql 允許遠(yuǎn)程連接
/usr/local/mysql/bin/mysql -u root -p (進(jìn)入mysql)
use mysql;
SELECT `Host`,`User` FROM user;
UPDATE user SET `Host` = '%' WHERE `User` = 'root' LIMIT 1;
flush privileges;
注意在mysql 命令行形式下一定要輸入";".
v經(jīng)過configure就可以make了
Linux mysql
make install注意pdo_mysql的全路徑,我的是:
/usr/local/php/lib/php/extensions/debug-non-zts-20060613/pdo_mysql.so
然后在/usr/local/lib/php.ini
加上一句:
extension=/usr/local/php/lib/php/extensions/debug-non-zts-20060613/pdo_mysql.so
重新啟動(dòng)apache即可看到已經(jīng)加載pdo_mysql成功。
關(guān)鍵詞標(biāo)簽:linux,mysql,遠(yuǎn)程連接
相關(guān)閱讀
熱門文章 10款MySQL數(shù)據(jù)庫客戶端圖形界面管理工具推薦MySQL常用維護(hù)管理工具Linux VPS/服務(wù)器上輕松導(dǎo)入、導(dǎo)出MySQL數(shù)據(jù)MySQL復(fù)制的概述、安裝、故障、技巧、工具
人氣排行 MySQL數(shù)據(jù)庫啟動(dòng)失敗1067進(jìn)程意外終止的解決辦法總結(jié)Mysql 1045錯(cuò)誤解決辦法10款MySQL數(shù)據(jù)庫客戶端圖形界面管理工具推薦MySQL服務(wù)器進(jìn)程CPU占用100%解決辦法MySQL導(dǎo)出導(dǎo)入命令的用例MySQL無法啟動(dòng)、無法停止各種解決方法總結(jié)三種常用的MySQL建表語句Mysql清空表的實(shí)現(xiàn)方法