MySQL的安裝

來源:互聯網
上載者:User

標籤:mysql

Centos6.0以上版本

正式安裝MySQL之前,需要安裝三個個組件,一個是Cmake(mysql軟體的安裝編譯軟體),一個是ncurese(提供終端字元處理庫,一個是perl(稱為“實用報表提取語言)

兩個軟體的為
Cmake: http://www.cmake.org/files/v3.0/cmake-3.0.0.tar.gz 
ncursese:ftp://invisible-island.net/ncurses/ncurses.tar.gz
 http://www.cpan.org/src/5.0/perl-5.20.0.tar.gz
使用tar xzvf解壓之後,進行目錄,依次使用
shell>./configure 
shell>make
shell>make install
即可成功安裝。

正式安裝MySQL的安裝:
:http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.19.tar.gz
使用tar xzvf 進入解壓縮檔案目錄。使用如下命令安裝:
shell>cmake .
shell>make
shell>make install ,預設安裝到/usr/local/mysql目錄。
進入安裝目錄:shell>cd /usr/local/mysql
建立mysql使用者和組
shell>groupadd mysql
shell>useradd -r -g mysql mysql
shell> chown -R mysql .
shell>chgrp -R mysql .
shell>scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --ldata=/var/lib/mysql
shell>chown -R root .
shell>chown -R mysql data
 
shell> mkdir /var/run/mysqld
 shell> touch /var/run/mysqld/mysqld.pid
 shell> chown -R mysql:mysql /var/run/mysqld
 shell>chmod -R 755 /var/run/mysqld
shell> bin/mysqld_safe  --user=mysql &
shell> cp support-files/mysql.server /etc/init.d/mysql.server
   

To start mysqld at boot time you have tocopy

support-files/mysql.server to the rightplace for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THEMySQL root USER !

To do so, start the server, then issue thefollowing commands:

  ./bin/mysqladmin -u root password‘new-password‘

  ./bin/mysqladmin -u root -h server.sanm.orgpassword ‘new-password‘

Alternatively you can run:

  ./bin/mysql_secure_installation

which will also give you the option ofremoving the testdatabases and anonymous user created by default.  This isstrongly recommended for productionservers.See the manual for more instructions.

You can start the MySQL daemon with:

cd .; ./bin/mysqld_safe &

You can test the MySQL daemon withmysql-test-run.pl

  cd mysql-test ; perl mysql-test-run.pl

Please report any problems athttp://bugs.mysql.com/

The latest information about MySQL isavailable on the web at http://www.mysql.com

Support MySQL by buying support/licenses athttp://shop.mysql.com New default configfile was created as ./my.cnf and will be used by default by the server when youstart it. You may edit this file to change server settings

WARNING: Default config file /etc/my.cnfexists on the system This file will be read by default by the MySQL server Ifyou do not want to use this, either remove it, or use the --defaults-fileargument to mysqld_safe when starting the server



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.