Linux下Mysql 5.5.15安裝手記

來源:互聯網
上載者:User

Mysql 5.5.15使用了新的cmake編譯方式
 
 
Setup 1:檢查是否安裝好了cmake——cmake -i
安裝cmake
wget -c http://www.cmake.org/files/v2.8/cmake-2.8.3.tar.gz
tar -zxvf cmake-2.8.3.tar.gz
cd cmake-2.8.3
./bootstrap
./configure
make && make install
Setup 2:
安裝MYSQL 5.5.8
wget -c http://mysql.mirrors.pair.com/Downloads/MySQL-5.5/mysql-5.5.15.tar.gz
 
tar -zxvf mysql-5.5.15.tar.gz
 
cd mysql-5.5.15/
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DWITH_READLINE=1 -DWITH_EMBEDDED_SERVER=1 -DWITH_SSL=system -DENABLED_LOCAL_INFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -LH
 
make && make install
慢長的等待過後終於完成了

groupadd mysql
useradd -g mysql mysql
cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
 
vim /etc/my.cnf #需要加入basedir,和datadir否則會出問題
[mysqld]
basedir =/usr/local/mysql
datadir =/usr/local/mysql/data
 
/usr/local/mysql/scripts/mysql_install_db –user=mysql
chown -R mysql /usr/local/mysql/data
chgrp -R mysql /usr/local/mysql/.
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
chmod 755 /etc/init.d/mysql
chkconfig –level 345 mysql on
echo “/usr/local/mysql/lib/mysql” >> /etc/ld.so.conf
echo “/usr/local/lib” >>/etc/ld.so.conf
 
ldconfig
/etc/init.d/mysql start
/usr/local/mysql/bin/mysqladmin -u root password 你的MYSQL密碼
/etc/init.d/mysql restart
/etc/init.d/mysql stop
 
OK終於完成~
 

常見問題:
 
1. /etc/init.d/mysql: line 256: my_print_defaults: command not found
 
解決方案: 檢查/etc/my.cnf是否存在datadir和basedir如果沒有請增加 datadir和basedir目錄路徑.
 
如下
[mysqld]
port = 3306
basedir =/usr/local/mysql
datadir =/usr/local/mysql/data
This entry was posted in Mysql. Bookmark the permalink.
本文出自 “劉世發” 部落格

聯繫我們

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