mysqld_multi启动多个实例

Posted on Posted in mysql
Tips: 本文创建于2016年3月24日,已超过 2 年,内容或图片可能已经失效!

> 本操作在安装-初始化mysql之后操作

  1. bin/mysqld_multi --example > etc/mysqld_multi.cnf  
  2. #输出以下内容,自行修改相应目录  
  3.   
  4. [mysqld_multi]  
  5. mysqld     = /usr/local/mysql/bin/mysqld_safe  
  6. mysqladmin = /usr/local/mysql/bin/mysqladmin  
  7. #user       = multi_admin  
  8. #password   = my_password  
  9.   
  10. [mysqld2]  
  11. socket     = /tmp/mysql.sock2  
  12. port       = 3307  
  13. pid-file   = /usr/local/mysql/data2/hostname.pid2  
  14. datadir    = /usr/local/mysql/data2  
  15. language   = /usr/local/mysql/share/mysql/english  
  16. user       = unix_user1  
  17.   
  18. [mysqld3]  
  19. mysqld     = /path/to/mysqld_safe  
  20. ledir      = /path/to/mysqld-binary/  
  21. mysqladmin = /path/to/mysqladmin  
  22. socket     = /tmp/mysql.sock3  
  23. port       = 3308  
  24. pid-file   = /usr/local/mysql/data3/hostname.pid3  
  25. datadir    = /usr/local/mysql/data3  
  26. language   = /usr/local/mysql/share/mysql/swedish  
  27. user       = unix_user2  
  28.   
  29. [mysqld4]  
  30. socket     = /tmp/mysql.sock4  
  31. port       = 3309  
  32. pid-file   = /usr/local/mysql/data4/hostname.pid4  
  33. datadir    = /usr/local/mysql/data4  
  34. language   = /usr/local/mysql/share/mysql/estonia  
  35. user       = unix_user3  
  36.    
  37. [mysqld6]  
  38. socket     = /tmp/mysql.sock6  
  39. port       = 3311  
  40. pid-file   = /usr/local/mysql/data6/hostname.pid6  
  41. datadir    = /usr/local/mysql/data6  
  42. language   = /usr/local/mysql/share/mysql/japanese  
  43. user       = unix_user4  

> 在mysql安装目录中,有support-files/mysqld_multi.server文件,修改相应目录,作为启动服务

> 手动启动/停止

  1. bin/mysqld_multi --defaults-extra-file=etc/mysqld_multi.cnf start|reload|stop|report 2,3,4,5,6  
» 转载请注明来源:若我若鱼 » mysqld_multi启动多个实例

Leave a Reply

Your email address will not be published. Required fields are marked *

fourteen − 3 =