mysql多執行個體安裝方法

來源:互聯網
上載者:User

標籤:mysql多執行個體安裝方法 mysql多執行個體安裝

1.CentOS5.8 x86_64位 採用迷你安裝,系統經過了基本最佳化篇
2.nginx版本:nginx-1.4.7
3.源碼包存放位置:/home/oldboy/tools
4.源碼包編譯安裝位置:/application/
5.已經安裝了單一實例的mysql,路徑在/usr/local/mysql

一.mysql多執行個體啟動設定
    1.建立目錄:
        [[email protected] ~]# mkdir /data/{3306,3307}/data -p
        [[email protected] ~]# tree /data
        /data
        |-- 3306
        |   `-- data
        |-- 3307
        |   `-- data
    2.關閉單一實例的mysql自動啟
        [[email protected] 3307]# chkconfig --list mysqld
        mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off
        [[email protected] 3307]# chkconfig mysqld off ;
        [[email protected] 3307]# chkconfig --list mysqld
        mysqld          0:off   1:off   2:off   3:off   4:off   5:off   6:off
    3.上傳啟動和設定檔my.cnf,mysql啟動指令碼到對應的目錄下面
        [[email protected] data]# cd 3306
        [[email protected] 3306]# ls
        data
        [[email protected] 3306]# rz
        rz waiting to receive.
        Starting zmodem transfer.  Press Ctrl+C to cancel.
        Transferring my.cnf...
          100%       1 KB       1 KB/sec    00:00:01       0 Errors  
        Transferring mysql...
          100%       1 KB       1 KB/sec    00:00:01       0 Errors
    4.修改/data目錄的屬主
        [[email protected] bin]# chown mysql:mysql /data
    5.增加mysql啟動指令碼的執行許可權
        [[email protected] bin]# chmod 700 /data/3306/mysql
        [[email protected] bin]# ll /data/3306/mysql       
        -rwx------ 1 mysql mysql 1053 Apr 12  2012 /data/3306/mysql

        [[email protected] bin]# chmod 700 /data/3307/mysql
    6.安裝資料庫
        [[email protected] bin]# mysql_install_db --datadir=/data/3307/data --user=mysql
        [[email protected] bin]# mysql_install_db --datadir=/data/3306/data --user=mysql
    7.設定mysql資料庫的登陸密碼
        [[email protected] 3306]# mysqladmin -uroot password ‘mybaby3307‘ -S /data/3307/mysql.sock
        [[email protected] 3306]# mysql -uroot -p -S /data/3307/mysql.sock
        Enter password:
        Welcome to the MySQL monitor.  Commands end with ; or \g.
        Your MySQL connection id is 2
        Server version: 5.1.73-log Source distributio
    8.安裝過程報錯處理方法:
        A.錯誤1
        InnoDB: Error: auto-extending data file ./ibdata1 is of a different size    #原因,ibdata1和設定檔的大小不對應
        InnoDB: 1024 pages (rounded down to MB) than specified in the .cnf file:
        InnoDB: initial 1088 pages, max 0 (relevant if non-zero) pages!
        InnoDB: Could not open or create data files.
        InnoDB: If you tried to add new data files, and it failed here,
        InnoDB: you should now edit innodb_data_file_path in my.cnf back
        B.錯誤2
        InnoDB: Database physically writes the file full: wait...
        InnoDB: Progress in MB: 100
        InnoDB: Error: all log files must be created at the same time.
        InnoDB: All log files must be created also in database creation.    #目錄下的LOG檔案時間ibdata1建立時間不一致
        InnoDB: If you want bigger or smaller log files, shut down the
        InnoDB: database and make sure there were no errors in shutdown.
        InnoDB: Then delete the existing log files. Edit the .cnf file
        InnoDB: and start the database again.
        141027 10:42:26 [ERROR] Plugin ‘InnoDB‘ init function returned error.
        141027 10:42:26 [ERROR] Plugin ‘InnoDB‘ registration as a STORAGE ENGINE failed.
        141027 10:42:26 [ERROR] Unknown/unsupported table type: InnoDB
        141027 10:42:26 [ERROR] Aborting

        處理方法:
            刪除ibdata1,ip_*的log,啟動mysql正常
            [[email protected] data]# rm ibdata1
            rm: remove regular file `ibdata1‘?

            [[email protected] data]# rm ib*
            rm: remove regular file `ibdata1‘?
            [[email protected] data]# rm ib* -f
            [[email protected] data]# ll
            total 8
            drwx------ 2 mysql root 4096 Oct 27 08:44 mysql
            drwx------ 2 mysql root 4096 Oct 27 08:44 test

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.