Linux MySql安裝步驟

來源:互聯網
上載者:User

標籤:

本文將以MySQL 5.5.47為例,以CentOS 6.5為平台,講述MySQL資料庫的安裝和設定。源碼包方式安裝1.建立MySql使用者和使用者組groupadd mysqluseradd -r -g mysql -M mysqlyum install boost-develtar -zxvf mysql-5.5.47.tar.gzyum install cmakeyum install gc-develyum install gityum install gcc-c++yum install ncurses-develrm -rf CMakeCache.txt[[email protected] mysql-5.7.7-rc]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ [MySQL安裝的根目錄]-DSYSCONFDIR=/etc \ [MySQL設定檔所在目錄]-DMYSQL_USER=mysql [MySQL使用者名稱]make make installchown -R mysql:mysql /usr/local/mysqlchmod -R 755 /usr/local/mysqlcd /usr/local/mysqlcp ./support-files/my-medium.cnf /etc/my.cnf./scripts/mysql_install_db --user=mysqlcp ./support-files/mysql.server /etc/rc.d/init.d/mysqldchmod +x /etc/rc.d/init.d/mysqldchkconfig --add mysqldchkconfig --list mysqldservice mysqld startservice mysqld stop 執行下面的命令關閉開機自啟動:chkconfig mysqld off執行下面的命令可以改變開機自啟動的運行層級為3、5: chkconfig --level 35 mysqld on3.1.11 將mysql的bin目錄加入PATH環境變數編輯/etc/profile檔案:vi /etc/profile在檔案最後添加如下兩行:PATH=$PATH:/usr/local/mysql/binexport PATH執行下面的命令使所做的更改生效:. /etc/profilehttp://blog.csdn.net/xiamizy/article/details/2072525

  

Linux 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.