Linux mysql敕令裝置許可長途銜接的裝置設置辦法。本站提示廣大學習愛好者:(Linux mysql敕令裝置許可長途銜接的裝置設置辦法)文章只能為提供參考,不一定能成為您想要的結果。以下是Linux mysql敕令裝置許可長途銜接的裝置設置辦法正文
而這些器械,恰是老手很迷惑的處所。一下是我的裝置筆記,在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
[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重啟便可長途拜訪