Linux系統下非管理員安裝mysql

來源:互聯網
上載者:User

一、下載相關包(必須是源碼包)
mysql-5.0.22.tar.gz

  二、運行configure
./configure --prefix=/data1/zhangsc/local/mysql --with-mysqld-user=zhsc --with-unix-socket-path=/data1/zhangsc/local/mysql.sock --localstatedir=/data1/zhangsc/local/mysql/data --enable-assembler --with-mysqld-ldflags=-all-static --with-low-memory --with-mit-threads

  三、按照以往安裝源碼包的步驟進行make、make install

  四、編寫my.cnf檔案,檔案內容如下:
[mysqld]

#資料庫路徑,裡面的內容可以從運行正常的資料庫中拷貝過來
datadir=/data1/zhangsc/local/mysql/data

#管道檔案,指定管道檔案的路徑,與安裝時configure中的配置一致
socket=/data1/zhangsc/local/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
[mysql.server]
user=mysql

#mysql的庫路徑

basedir=/data1/zhangsc/local/mysql/lib/mysql

[mysqld_safe]

#mysql錯誤記錄檔路徑
err-log=/data1/zhangsc/local/mysql/log/mysqld.log

#mysql的pid路徑無論哪裡都行,只要有許可權訪問即可
pid-file=/data1/zhangsc/local/mysql/mysqld.pid

  五、啟動資料庫伺服器:
  進入mysql的bin路徑下運行一下程式即可:./mysqld_safe --defaults-file=my.cnf

聯繫我們

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