MySQL Multi-Instance installation method

Source: Internet
Author: User

The 1.centos5.8 x86_64 is minimized, and the system has undergone a basic optimization
2.nginx version: nginx-1.4.7
3. Source Package storage Location:/home/oldboy/tools
4. Source Package Compilation Installation Location:/application/
5. A single-instance MySQL is already installed and the path is/usr/local/mysql

I. MySQL multi-instance startup settings
1. Create a new directory:
[Email protected] ~]# mkdir/data/{3306,3307}/data-p
[Email protected] ~]# Tree/data
/data
|--3306
| '--data
|--3307
| '--data
2. Turn off single-instance MySQL auto-start
[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. Upload the startup and configuration files my.cnf,mysql boot script to the corresponding directory
[[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. Modify the owner of the/data directory
[Email protected] bin]# chown Mysql:mysql/data
5. Increase the execution rights of MySQL startup scripts
[Email protected] bin]# chmod 700/data/3306/mysql
[Email protected] bin]# Ll/data/3306/mysql
-rwx------1 MySQL mysql 1053 Apr 2012/data/3306/mysql

[Email protected] bin]# chmod 700/data/3307/mysql
6. Install the database
[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. Set the login password for MySQL database
[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. Installation process error handling method:
A. Error 1
innodb:error:auto-extending data file./ibdata1 is adifferent size#原因, Ibdata1 does not correspond to the size of the configuration file
innodb:1024 pages (rounded 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 tried to add new data files, and it failed here,
Innodb:you should now edit Innodb_data_file_path on my.cnf back
B. Error 2
Innodb:database physically writes the file full:wait ...
Innodb:progress in mb:100
Innodb:error:All log files must is created at the same time.
Innodb:all log files must is created also in database creation. #目录下的LOG文件时间ibdata1创建时间不一致
Innodb:if 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

Processing Method:
Delete ibdata1,ip_* log, start MySQL normal
[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 08:44 MySQL
drwx------2 MySQL root 4096 Oct 08:44 test

MySQL Multi-Instance installation method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.