linux編譯安裝mysql5.1.x

來源:互聯網
上載者:User

標籤:embed   enable   工作   pat   eve   許可權   move   read   arch   

安裝mysql,安裝前準備

如果mysql使用者不存在,那麼添加mysql使用者

groupadd mysqluseradd -g mysql mysql

  

mysql編譯安裝

make時間特別長

wget http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.70.tar.gztar -zxvf mysql-5.1.70.tar.gzcd mysql-5.1.70 yum install ncurses ncurses-devel./configure  ‘--prefix=/usr/local/mysql‘ ‘--without-debug‘ ‘--with-charset=utf8‘ ‘--with-extra-charsets=all‘ ‘--enable-assembler‘ ‘--with-pthread‘ ‘--enable-thread-safe-client‘ ‘--with-mysqld-ldflags=-all-static‘ ‘--with-client-ldflags=-all-static‘ ‘--with-big-tables‘ ‘--with-readline‘ ‘--with-ssl‘ ‘--with-embedded-server‘ ‘--enable-local-infile‘ ‘--with-plugins=innobase‘makemake install

  

到此mysql就安裝到了/usr/local/mysql路徑下,下面開始mysql的配置工作
------------------------------------

安裝mysql選項檔案

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

  

mysql設定開機自啟動

cp -r support-files/mysql.server /etc/init.d/mysqld  /sbin/chkconfig --del mysqld/sbin/chkconfig --add mysqld

  

配置許可權表

chown -R mysql:mysql /usr/local/mysql/usr/local/mysql/bin/mysql_install_db --user=mysql

  

 

啟動mysql

給/etc/init.d/mysql 執行許可權,然後運行

chmod a+wrx /etc/init.d/mysql/etc/init.d/mysqld start

  

mysql初始化配置:

包括密碼設定等

export PATH=/usr/local/mysql/bin:$PATH/usr/local/mysql/bin/mysql_secure_installation  

 

在彈出的對話方塊中要求輸入密碼:

Enter current password for root (enter for none):

預設打斷行符號,然後重新設定root密碼:

Set root password? [Y/n] y

Disallow root login remotely? [Y/n] n

Remove test database and access to it? [Y/n] n

Reload privilege tables now? [Y/n] y

 

至此,Mysql運行成功

 

linux編譯安裝mysql5.1.x

相關文章

聯繫我們

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