MySQL 5.5.17 源碼安裝

來源:互聯網
上載者:User

標籤:linux   mysql   使用者組   

工作需要使用MySQL,在linux中用yum安裝,安裝路徑不可控,不能對它進行定製,為了更好的管理MySQL Sever,採用源碼安裝。


MySQL 5.5.17安裝需要使用cmake編譯工具,可以使用yum 來安裝cmake


安裝MySQL DB

建立相關使用者組及使用者

 groupadd mysql useradd –g mysql mysql

在存放MySQL源碼包路徑解壓並且安裝(手動建立相應安裝目錄)

#mkdir /opt/mysql#chown -R mysql:mysql /opt/mysql#gunzip mysql-5.5.17.tar.gz#tar xvf mysql-5.5.17.tar#cd mysql-5.5.17cmake  -DCMAKE_INSTALL_PREFIX=/opt/mysql -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306 -DMYSQL_DATADIR=/opt/mysql/data -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DWITH_READLINE=1 -DWITH_SSL=yes -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all#make#make install 初始化DB# sh scripts/mysql_install_db --user=mysql --basedir=/opt/mysql --datadir=/opt/mysql/dataInstalling MySQL system tables...OKFilling help tables...OK To start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !To do so, start the server, then issue the following commands: /opt/mysql/bin/mysqladmin -u root password ‘new-password‘/opt/mysql/bin/mysqladmin -u root -h mysql password ‘new-password‘ Alternatively you can run:/opt/mysql/bin/mysql_secure_installation which will also give you the option of removing the testdatabases and anonymous user created by default.  This isstrongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with:cd /opt/mysql ; /opt/mysql/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.plcd /opt/mysql/mysql-test ; perl mysql-test-run.pl Please report any problems with the /opt/mysql/scripts/mysqlbug script!

完成後按照正常mysql的配置啟動方式啟動MySQL server

本文出自 “DBA的天空” 部落格,請務必保留此出處http://kevinora.blog.51cto.com/9406404/1665710

MySQL 5.5.17 源碼安裝

聯繫我們

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