二進位方式安裝MySQL資料庫

來源:互聯網
上載者:User

標籤:資料庫   二進位   記錄   使用者   

  對於一般使用者而言喜歡編譯安裝或者yum安裝,在本人工作中,一般都是用二進位快速安裝,這裡講安裝步驟記錄如下:

1.下載二進位檔案到目錄/home/www/tools下

[[email protected] tools]# ll

total 102

-rw-r--r-- 1 root   root  186722932 Apr 22  2015 mysql-5.5.32-linux2.6-x86_64.tar.gz

[[email protected] tools]# 

2.建立/application目錄和及其下面子目錄/application/mysql、/application/mysql/data

[[email protected] tools]# mkdir -p /application/mysql/data

[[email protected] tools]# tree /application/

/application/

└── mysql

    └── data


2 directories, 0 files

[[email protected] tools]# 



3.安裝mysql

ls mysql-5.5.32-linux2.6-x86_64.tar.gz 

tar xf mysql-5.5.32-linux2.6-x86_64.tar.gz 

mv mysql-5.5.32-linux2.6-x86_64 /application/mysql-5.5.32

ln -s /application/mysql-5.5.32 /application/mysql 

##########相當於編譯步驟的make install完成#############

 

4.建立使用者和目錄

useradd mysql -s /sbin/nologin -M

chown -R mysql.mysql /application/mysql/data/

 

5.初始化資料庫

cd /application/mysql

./scripts/mysql_install_db --user=mysql --basedir=/application/mysql --datadir=/application/mysql/data/

\cp support-files/my-small.cnf  /etc/my.cnf

cp support-files/mysql.server /etc/init.d/mysqld

chmod +x /etc/init.d/mysqld 

sed -i ‘s#/usr/local/mysql#/application/mysql#g‘ /application/mysql/bin/mysqld_safe /etc/init.d/mysqld

/etc/init.d/mysqld start

netstat -lntup|grep mysql

cp -a /application/mysql/bin/* /usr/local/sbin/

mysqladmin password Tnt123

mysql -uroot -pTnt123


本文出自 “平平淡淡才是真” 部落格,請務必保留此出處http://cryan.blog.51cto.com/10837891/1719529

二進位方式安裝MySQL資料庫

聯繫我們

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