二進位檔案裝mysql

來源:互聯網
上載者:User

標籤:mysql linux

    近日通過二進位檔案裝mysql 做了一些總結。

   

1.下載二進位包

wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.32-linux-glibc2.5-i686.tar.gz

2.解壓包

tar zxvf mysql-5.6.32-linux-glibc2.5-i686.tar.gz

3.移動包到/usr/loacl/mysql

mv mysql-5.6.32-linux-glibc2.5-i686 /usr/local/mysql

4.建立mysql使用者

useradd -s /sbin/nologin mysql

5.進入/usr/mysql目錄

cd /usr/local/mysql/

6.建立mysql資料目錄

mkdir -p /data/mysql

7.添加所屬主

chown -R mysql:mysql /data/mysql

8.初始化資料庫

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

看到兩個ok說明初始化完成

9.複製啟動設定檔到/etc/init.d/mysqld和設定檔到/etc/mysql

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

cp support-files/my-large.cnf /etc/my.cnf

10.賦予執行許可權

chmod 755 /etc/init.d/mysqld

11.在/etc/mysql.cnf中添加或更更改如下配置

[client]

port = 3306

socket = /tmp/mysql.sock


[mysqld]


basedir = /usr/local/mysql

datadir = /data/mysql

port = 3306

server_id = 1

socket = /tmp/mysql.sock

pid-file=/data/mysql/mysql.pid

12.添加mysql到啟動項

chkconfig --add mysqld

chkconfig mysqld on

啟動mysql

service mysqld start

檢查mysql是否啟動

ps -aux|grep mysql


本文出自 “我的linux學習之旅” 部落格,請務必保留此出處http://dousi.blog.51cto.com/9827926/1855923

二進位檔案裝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.