MySQL Startup multi-instance

Source: Internet
Author: User

Database configuration

Build the database file set in the MySQL home directory

mkdir data_3307mkdir data_3308mkdir data_3309

Configure the database in the MySQL home 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 Boot configuration file
[Mysqld_multi]mysqld=/home/fanbin/code/mysql/bin/mysqld mysqladmin=/home/fanbin/code/mysql/bin/mysqladmin user=Root [mysqld3307]socket=/tmp/mysql_3307.sock port=3307 datadir=/home/fanbin/code/mysql/data_3307/ user=MySQL [mysqld3308]socket=/tmp/mysql_3308.sock port=3308 datadir=/home/fanbin/code/mysql/data_3308/ user=MySQL [mysqld3309]socket=/tmp/mysql_3309.sock port=3309 datadir=/home/fanbin/code/mysql/data_3309/ user=MySQL 
Start the database

Starting multiple instances in the Bin directory

./mysqld_multi --defaults-file=/home/fanbin/code/mysql/my_multi.cnf start 3307,3308,3309
Other
Set a new password mysqladmin-uroot - S/tmp/mysql_3307.Sock password123456Log in to the database MySQL-uroot - S/tmp/mysql_3307.Sock- PConfirm the logged in database show variables like'%datadir% '; Check the userSelectUser,host from MySQL.User; Change all root password update userSetPassword=Password' 123456 ')whereUser=' Root '; Change where host is%Update userSetHost= '% ' whereUser= ' Root '  andHost= ' HP '; FLUSH privileges; Check permissions MySQL>Show grants for root; Create user grantSelect  on *.*  to[Email protected]'% 'Identified by ' Fanbin 'Change the new Add User Password update userSetPassword=Password' 123456 ')whereUser=' Fanbin '; FLUSH privileges;

MySQL Startup multi-instance

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.