MySQL starts multiple instances and MySQL starts instances.

Source: Internet
Author: User

MySQL starts multiple instances and MySQL starts instances.
Database Configuration

Generate a database file set in the mysql main directory

mkdir data_3307mkdir data_3308mkdir data_3309

Configure the database in the mysql main directory

./scirpt/mysql_install_db --datadir=/home/fanbin/code/mysql/data_3307 --user=mysql./script/mysql_install_db --datadir=/home/fanbin/code/mysql/data_3308 --user=mysql ./script/mysql_install_db --datadir=/home/fanbin/code/mysql/data_3309 --user=mysql 
Multi-instance STARTUP configuration file
[mysqld_multi]mysqld=/home/fanbin/code/mysql/bin/mysqldmysqladmin=/home/fanbin/code/mysql/bin/mysqladminuser=root[mysqld3307]socket=/tmp/mysql_3307.sockport=3307datadir=/home/fanbin/code/mysql/data_3307/user=mysql[mysqld3308]socket=/tmp/mysql_3308.sockport=3308datadir=/home/fanbin/code/mysql/data_3308/user=mysql[mysqld3309]socket=/tmp/mysql_3309.sockport=3309datadir=/home/fanbin/code/mysql/data_3309/user=mysql
Start Database

Start Multiple instances in the bin directory

./mysqld_multi --defaults-file=/home/fanbin/code/mysql/my_multi.cnf start 3307,3308,3309
Others
Set the new password mysqladmin-uroot-S/tmp/mysql_3307.sock password 123456 to log on to the mysql-uroot-S/tmp/mysql_3307.sock-p to confirm that the database to be logged on is show variables like '% datadir % '; query the select user, host from mysql. user; change all root user passwords update user set password = password ('000000') where user = 'root '; change host to % update user set host = '%' where user = 'root' and host = 'hp '; flush privileges; check permission for mysql> show grants for root; create user grant select on *. * to fanbin @ '%' identified by 'fanbin'; change the newly added user password update user set password = password ('000000') where user = 'fanbin'; flush privileges;

Related Article

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.