• <ul id="mayc0"></ul>
    <ul id="mayc0"><center id="mayc0"></center></ul>
    <strike id="mayc0"><input id="mayc0"></input></strike>
    <ul id="mayc0"></ul>
  • 始創于2000年 股票代碼:831685
    咨詢熱線:0371-60135900 注冊有禮 登錄
    • 掛牌上市企業
    • 60秒人工響應
    • 99.99%連通率
    • 7*24h人工
    • 故障100倍補償
    您的位置: 網站首頁 > 幫助中心>文章內容

    Mysql Linux安裝小記

    發布時間:  2012/8/7 18:06:29

    1.Add a login user and group for `mysqld' to run as:為‘mysqld’增添一個登陸用戶和組
    shell> groupadd mysql
    shell> useradd -g mysql mysql

    2.解壓
    shell> gunzip < mysql-5.0.15.tar.gz | tar -xvf --
     

    shell> cd mysql-5.0.15

    3.Configure the release and compile everything:配置和編譯給configure分配可執行文件
    shell> chmod +x configure
    改變字符集為 GBK [默認字符集為ISO-8859-1(Latin1)]
    shell> ./configure --prefix=/usr/local/mysql --with-charset=gbk
    shell> make
    (字符集還有big5、cp1251、cp1257、czech、danish、dec8、dos、euc_kr、gb2312 gbk、german1、hebrew、 hp8、hungarian、koi8_ru、koi8_ukr、latin1、latin2、sjis、swe7、tis620、ujis、usa7、win1251或win1251ukr)

    4.安裝所有東西
    shell> make install

    5.如果你想安裝選項文件,使用當前存在的‘support-files’ 文件夾下的作為模板,例如:
    shell> cp support-files/my-medium.cnf /etc/my.cnf

    6.如果想mysqld每次開機自動啟動的話。cp -r support-files/mysql.server /etc/init.d/就行了
    shell> cp -r support-files/mysql.server /etc/init.d/mysql
    shell> cd /etc/rc.d/init.d
    shell> chmod +x mysql
    shell> /sbin/chkconfig --del mysql
    shell> /sbin/chkconfig --add mysql

    7.進入安裝目錄
    shell> cd /usr/local/mysql

    8.如果你以前沒有安裝過MySQL,你必須創建一個MySQL準許的表
    shell> bin/mysql_install_db --user=mysql

    9.將程序的所有權限給‘root’ ,并且把數據目錄的所有權給可以運行‘mysqld’的用戶。假設MySQL的安裝目錄是(‘/usr/local/mysql’),命令如下所示:
    把文件擁有權給‘root’
    shell> chown -R root .
    把數據目錄擁護權給‘mysql’用戶
    shell> chown -R mysql var
    把組的權限給'mysql'組
    shell> chgrp -R mysql .

    10.萬事具備后,你就可以按照下面的命令測試并運行你的MySQL了:
    shell> /usr/local/mysql/bin/mysqld_safe --user=mysql &
    shell> service mysql start

    11.在一切正常后,要做的第一件事情是更改管理員的密碼。你可以運行mysqladmin (請注意,此命令不一定在你的path中,所以最好是轉到此命令的目錄中直接執行):
    shell> cd bin
    shell> ./mysqladmin -u root password *********

    12.運行其他用戶訪問本機:
    shell> ./mysql -u root -p mysql
    --------------------這里輸入你剛才修改的管理員密碼
    mysql> update user set host='' where host='localhost' and user='root';
    mysql> exit
    Bye

    13.修改mysql數據庫端口號
    shell> vi /etc/my.cnf
    --------------------修改里面的 port=**** 為你需要的端口號

    14.重啟應用
    shell> service mysql restart
     


    本文出自:億恩科技【www.vbseamall.com】

    服務器租用/服務器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質保障!--億恩科技[ENKJ.COM]

  • 您可能在找
  • 億恩北京公司:
  • 經營性ICP/ISP證:京B2-20150015
  • 億恩鄭州公司:
  • 經營性ICP/ISP/IDC證:豫B1.B2-20060070
  • 億恩南昌公司:
  • 經營性ICP/ISP證:贛B2-20080012
  • 服務器/云主機 24小時售后服務電話:0371-60135900
  • 虛擬主機/智能建站 24小時售后服務電話:0371-60135900
  • 專注服務器托管17年
    掃掃關注-微信公眾號
    0371-60135900
    Copyright© 1999-2019 ENKJ All Rights Reserved 億恩科技 版權所有  地址:鄭州市高新區翠竹街1號總部企業基地億恩大廈  法律顧問:河南亞太人律師事務所郝建鋒、杜慧月律師   京公網安備41019702002023號
      0
     
     
     
     

    0371-60135900
    7*24小時客服服務熱線