Linux mysql命令安裝允許遠端連線的安裝設定方法

來源:互聯網
上載者:User

而這些東西,正是新手很困惑的地方。一下是我的安裝筆記,在Centos虛擬機器上安裝成功。中文的參考:http://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 檔案複製到/home/tmp目錄。接著執行下面的命令

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 .(注意有個.) 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(如果能進入mysql 命令列,說明mysql 配置成功。) edit /etc/my.cnf

[client] + default-character-set=utf8 [mysqld] + default-character-set=utf8 [mysql] + default-character-set=utf8

apache安裝,請先進入/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 允許遠端連線

/usr/local/mysql/bin/mysql -u root -p (進入mysql) use mysql; SELECT `Host`,`User` FROM user; UPDATE user SET `Host` = '%' WHERE `User` = 'root' LIMIT 1; flush privileges; 注意在mysql 命令列形式下一定要輸入";". v經過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
重新啟動apache即可看到已經載入pdo_mysql成功。

在ubuntu7.10中mysql安裝,預設是只能本機訪問的,需要開啟使用者權限和mysql的本機綁定
1、在命令列底下開啟使用者權限:grant all privileges on drupal.* to user@192.168.1.80 identified by 'user-password';
在管理員介面可以通過使用者管理add host->any host來添加存取權限(root使用者預設只能訪問本機,新添加的使用者可遠程)
2、取消mysql本機綁定:
編輯/etc/mysql/my.cnf
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
將”bind-address = 127.0.0.1“注釋
sudo /etc/init.d/mysql restart重啟即可遠端存取

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.