yum 安裝LAMP的一些問題

來源:互聯網
上載者:User

測試環境:CentOS 5.5
更新至20100712。
以前總是用原始碼編譯的來著,現在發現用yum安裝也挺好的,除了版本不是最新的外,其他的都挺好的,而且配置更方便了。不像php源碼安裝,需要with很多東西,有時候還會有些編譯問題。
1.安裝php之後的一些輔助包 php-mysql php-mbstring php-mcrypt php-eaccelerator php-gd php-libxml ImageMagick
2.安裝phpMyadmin後訪問報‘Permisson錯誤’,是因為/etc/httd/conf.d/phpMyAdmin.conf

   order deny,allow
   deny from all
   allow from 127.0.0.1
   allow from ::1

這裡阻止了外部的訪問,增加如下代碼,以支援遠端存取,可以根據需要修改
   allow from 192.168.189.1   --這是我的VMNet8網卡的地址
3.設定root密碼

a. ./mysqladmin -u root -p oldpassword password newpasswd(記住這個命令是在/usr/local/mysql/bin中外部命令)

b. SET PASSWORD FOR root=PASSWORD(’new password’);(對登入資料庫後這種方式)

c. mysql>UPDATE user SET password=PASSWORD('new password') WHERE user=’root’;  (對登入資料庫後這種方式)

mysql>flush privileges; 

3.查看資料庫字元集

mysql> show variables like 'character_set_%';

mysql> show variables like 'collation_%';

修改資料庫的字元集

    mysql>use mydb

    mysql>alter database mydb character set utf-8;

建立資料庫指定資料庫的字元集

    mysql>create database mydb character set utf-8;

在linux下修改3個my.cnf的1個/etc/mysql/my.cnf檔案

 

找到用戶端配置[client] 在下面添加
default-character-set=utf8 預設字元集為utf8
在找到[mysqld] 添加
default-character-set=utf8 預設字元集為utf8
init_connect='SET NAMES utf8' (設定串連mysql資料庫時使用utf8編碼,以讓mysql資料庫為utf8運行)

 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.