Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ Run two MySQL service on one server     - Linux command execution order control and pipeline (Linux)

- Install the latest Pinta graphics editing software on Ubuntu 14.04 (Linux)

- Linux 0.12 kernel and modern kernels difference in memory management (Linux)

- Linux regex awk Comments (Linux)

- Tor Browser: under Linux for anonymous Web browsing ultimate browser (Linux)

- Linux Getting Started tutorial: Experience VirtualBox Virtual Machine chapter (Linux)

- SSL VPN SSL VPN access to security websites patron (Linux)

- Via Twitter how open source library to be used anywhere Emoji emoticons (Linux)

- Differences Shell scripting languages and compiled languages (Programming)

- MD5 and simple to use (Linux)

- Several SQL Server data migration / Export Import Practice (Database)

- To install network scanning and packet sniffer tool Nmap 7.00 under ubuntu (Linux)

- Construction of Android and iOS apps use Jenkins Automation (Programming)

- The ActiveMQ JMS installation and application examples for Linux (Linux)

- Build your own Python coding environment (Linux)

- Emacs install clojure development environment (Linux)

- MySQL service failed to start thinking of settlement under CentOS7 (Database)

- CentOS6.3 build a Python 3.3 environment to access Oracle 11gR2 (Database)

- tcpdump Linux system security tools (Linux)

- Understand the profound discussion of some of the options for wireless encryption (Linux)

 
         
  Run two MySQL service on one server
     
  Add Date : 2018-11-21      
         
         
         
  Run two MySQL service on one server

A. Add a group to add, add users to groups, extract

groupadd mysql

useradd mysql -g mysql -M -s / sbin / nologin

tar -zxvf mysql-5.6.23-linux-glibc2.5-x86_64.tar.gz

tar -zxvf mysql-5.7.9-linux-glibc2.5-x86_64.tar.gz

mv mysql-5.6.23-linux-glibc2.5-x86_64 /mnt/sda4/mysql5.6.23

mv mysql-5.7.9-linux-glibc2.5-x86_64 /mnt/sda4/mysql65.7.9

mkdir -p /mnt/sda4/mysql5.6.23/data

mkdir -p /mnt/sda4/mysql5.7.9/data

II. The default initialization path

/ Usr / local / mysql / scripts / mysql_install_db --user = mysql --basedir = / usr / local / mysql --datadir = / usr / local / mysql / data

Safe Boot

/ Usr / local / mysql / bin / mysqld_safe --defaults-file = / etc / my.cnf way to start can not be closed after this, you must manually kill off

Using the startup script

cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld can service mysql stop | start | restart the

Three .mysql5.6.23 version

The file mysqld_safe, mysql.server, mysqld_multi.server, mysql-log-rotate inside the / usr / local / mysql to /mnt/sda4/mysql5.6.23. 5.7.9 version instead /mnt/sda4/mysql5.7.9

/mnt/sda4/mysql5.6.23/bin/mysqld_safe this file inside /tmp/mysql.sock---->/tmp/mysql5.6.23.sock 5.7.9 version instead /tmp/mysql5.7.9.sock

/mnt/sda4/mysql5.6.23/support-files/mysql.server

/mnt/sda4/mysql5.7.9/support-files/mysqld_multi.server

/mnt/sda4/mysql5.7.9/support-files/mysql-log-rotate

vim both inside% s / \ / usr \ / local \ / mysql / \ / mnt \ / sda4 \ /mysql5.6.23/g

IV. Modify permissions, configuration files

chown -R mysql: mysql /mnt/sda4/mysql5.6.23

[Root @ sam ~] # cat /etc/my5.6.23.cnf

[Mysqld]

basedir = /mnt/sda4/mysql5.6.23

datadir = /mnt/sda4/mysql5.6.23/data

port = 3306

socket = / tmp / mysql.sock

bind-address = 0.0.0.0

skip-external-locking

key_buffer_size = 16M

max_allowed_packet = 1M

table_open_cache = 64

sort_buffer_size = 512K

net_buffer_length = 8K

read_buffer_size = 256K

read_rnd_buffer_size = 512K

myisam_sort_buffer_size = 8M

max_allowed_packet = 4M

max_connections = 2000

innodb_buffer_pool_size = 3G

innodb_log_buffer_size = 256M

sql_mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES

V. make corresponding modifications

/mnt/sda4/mysql5.6.23/scripts/mysql_install_db --user = mysql --basedir = / mnt / sda4 / mysql5.6.23 --datadir = / mnt / sda4 / mysql5.6.23 / data

/mnt/sda4/mysql5.6.23/bin/mysqld_safe --defaults-file = / etc / my5.6.23.cnf test whether you can start

cp /mnt/sda4/mysql5.6.23/support-files/mysql.server /etc/init.d/mysql5.6.23

This allows service mysql stop | start | restart the

Six .mysql5.7.9 version initialize

Here we must note MySQL5.7.6 later blocked mysql_install_db only choose to install mysql --initialize

5.7.9 Configuration Profiles

[Root @ sam ~] # cat /etc/my5.7.9.cnf

[Mysqld]

basedir = /mnt/sda4/mysql5.7.9

datadir = /mnt/sda4/mysql5.7.9/data

port = 3307 <--- define and 5.6.23 different port number 3307

socket = / tmp / mysql.sock

bind-address = 0.0.0.0

skip-external-locking

key_buffer_size = 16M

max_allowed_packet = 1M

table_open_cache = 64

sort_buffer_size = 512K

net_buffer_length = 8K

read_buffer_size = 256K

read_rnd_buffer_size = 512K

myisam_sort_buffer_size = 8M

max_allowed_packet = 4M

max_connections = 2000

innodb_buffer_pool_size = 3G

innodb_log_buffer_size = 256M

sql_mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES

VII. Perform initialization and test startup scripts

/mnt/sda4/mysql5.7.9/bin/mysqld --defaults-file = / etc / my5.7.9.cnf --initialize

/mnt/sda4/mysql5.7.9/bin/mysqld_safe --defaults-file = / etc / my5.7.9.cnf

[Root @ sam bin] # ./mysqld --defaults-file = / etc / my5.7.9.cnf --initialize

2015-11-19T14: 40: 52.540335Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated Please use --explicit_defaults_for_timestamp server option (see documentation for more details)..

2015-11-19T14: 40: 52.540810Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode They will be merged with strict mode in a future release..

2015-11-19T14: 40: 52.540816Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.

2015-11-19T14: 40: 55.180025Z 0 [Warning] InnoDB: New log files created, LSN = 45790

2015-11-19T14: 40: 55.500690Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.

2015-11-19T14: 40: 55.601943Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started Generating a new UUID:. 8a648e5a-8ecb-11e5-911c- 0050569c4b72.

2015-11-19T14: 40: 55.630337Z 0 [Warning] Gtid table is not ready to be used Table 'mysql.gtid_executed' can not be opened..

2015-11-19T14: 40: 55.631059Z 1 [Note] A temporary password is generated for root @ localhost: ze: OCyh) U1 & y <------ random password

[Root @ sam bin] # ./mysqld_safe --defaults-file = / etc / my5.7.9.cnf

151119 22:42:26 mysqld_safe Logging to '/mnt/sda4/mysql5.7.9/data/sam.adsame.com.err'.

151119 22:42:26 mysqld_safe The file / usr / local / mysql / bin / mysqld

does not exist or is not executable. Please cd to the mysql installation

directory and restart this script from there as follows:

./bin/mysqld_safe&

See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more information

VIII. See process started

[Root @ sam ~] # ps aux | grep mysql

root 30783 0.0 0.0 66064 1336 pts / 4 S 23:02 0:00 / bin / sh /mnt/sda4/mysql5.7.9/bin/mysqld_safe --datadir = / mnt / sda4 / mysql5.7.9 / data --pid- file = / mnt / sda4 / mysql5.7.9 / data / sam.adsame.com.pid

mysql 31110 0.5 10.2 4504488 414676 pts / 4 Sl 23:02 0:00 /mnt/sda4/mysql5.7.9/bin/mysqld --basedir = / mnt / sda4 / mysql5.7.9 --datadir = / mnt / sda4 / mysql5 .7.9 / data --plugin-dir = / mnt / sda4 / mysql5.7.9 / lib / plugin --user = mysql --log-error = / mnt / sda4 / mysql5.7.9 / data / sam.adsame.com. err --pid-file = / mnt / sda4 / mysql5.7.9 / data / sam.adsame.com.pid --socket = / tmp / mysql5.7.9.sock --port = 3307

root 31169 0.0 0.0 65932 1336 pts / 4 S 23:02 0:00 / bin / sh /mnt/sda4/mysql5.6.23/bin/mysqld_safe --datadir = / mnt / sda4 / mysql5.6.23 / data --pid- file = / mnt / sda4 / mysql5.6.23 / data / sam.adsame.com.pid

mysql 31732 1.0 30.1 4601900 1217628 pts / 4 Sl 23:02 0:01 /mnt/sda4/mysql5.6.23/bin/mysqld --basedir = / mnt / sda4 / mysql5.6.23 --datadir = / mnt / sda4 / mysql5 .6.23 / data --plugin-dir = / mnt / sda4 / mysql5.6.23 / lib / plugin --user = mysql --log-error = / mnt / sda4 / mysql5.6.23 / data / sam.adsame.com. err --pid-file = / mnt / sda4 / mysql5.6.23 / data / sam.adsame.com.pid --socket = / tmp / mysql5.6.23.sock --port = 3306

root 31770 0.0 0.0 61160 740 pts / 1 S + 23:04 0:00 grep mysql

IX. Client connections

/mnt/sda4/mysql5.6.23/bin/mysql -uroot -P3306 -h127.0.0.1

/mnt/sda4/mysql5.7.9/bin/mysql -uroot -P3307 -h127.0.0.1

mysql5.7.9 Change Password

/mnt/sda4/mysql5.7.9/bin

[Root @ sam bin] # ./mysqladmin -uroot -P3307 -h127.0.0.1 -p password
     
         
         
         
  More:      
 
- Mac OS X systems create Ubuntu USB boot disk for the Mac (Linux)
- To install Oracle Database Details and FAQ Summary under CentOS (Database)
- How do you temporarily emptied Bash environment variable before running the command on Linux (Linux)
- Use PuTTY key authentication mechanism for remote login Linux (Linux)
- Linux Variable content removal and replacement (Linux)
- How to create a remote (Linux)
- Java MVC CRUD examples (Programming)
- Circular list of Java programming (Programming)
- Shared directory settings between Linux and Linux (Linux)
- Firewall chapter of Linux server security configuration (Linux)
- A new method for Linux hidden files (Linux)
- Hunk / Hadoop: Performance Best Practices (Server)
- Programmers Do not neglect debugging techniques (Programming)
- Linux Firewall Basics (Linux)
- Web cache basics: terminology, HTTP headers, and caching policies (Server)
- Linux kernel source tree to establish load module hello (Linux)
- Java interview questions in nine radio (Programming)
- ORA-600 [kcbz_check_objd_typ] Error Handling (Database)
- Spring JDBC Comments (Programming)
- MySQL appears data too long for column 'name' at row 1 to solve (Database)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.