程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> MYSQL數據庫 >> 關於MYSQL數據庫 >> mysql命令安裝允許遠程連接

mysql命令安裝允許遠程連接

編輯:關於MYSQL數據庫

       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 [email protected] 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重啟即可遠程訪問

    1. 上一頁:
    2. 下一頁:
    Copyright © 程式師世界 All Rights Reserved