Mysql启动的方式(四种)
网络编程 2021-07-05 15:28www.168986.cn编程入门
本文给大家介绍四种mysql启动方式,实用性非常高,感兴趣的朋友参考下吧
废话不多说了,直奔主题了。
mysql的四种启动方式:
1、mysqld
启动mysql服务器:./mysqld --defaults-file=/etc/my.f --user=root
客户端连接:
mysql --defaults-file=/etc/my.f or mysql -S /tmp/mysql.sock
2、mysqld_safe
启动mysql服务器:./mysqld_safe --defaults-file=/etc/my.f --user=root &
客户端连接:
mysql --defaults-file=/etc/my.f or mysql -S /tm/mysql.sock
3、mysql.server
cp -v /usr/local/mysql/support-files/mysql.server /etc/init.d/ chkconfig --add mysql.server
启动mysql服务器:service mysql.server {start|s|restart|reload|force-reload|status}
客户端连接:同1、2
4、mysqld_multi
mkdir $MYSQL_BASE/data2 cat <<-EOF>> /etc/my.f [mysqld_multi] mysqld = /usr/local/mysql/bin/mysqld_safe mysqladmin = /user/local/mysql/bin/mysqladmin user = mysqladmin password = mysqladmin [mysqld3306] port = 3306 socket = /tmp/mysql3306.sock pid-file = /tmp/mysql3306.pid skip-external-locking key_buffer_size = 16M max_allowed_packet = 1M table_open_cache = 64 sort_buffer_size = 512K _buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M basedir = /usr/local/mysql datadir = /usr/local/mysql/data [mysqld3307] port = 3307 socket = /tmp/mysql3307.sock pid-file = /tmp/mysql3307.pid skip-external-locking key_buffer_size = 16M max_allowed_packet = 1M table_open_cache = 64 sort_buffer_size = 512K _buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M basedir = /usr/local/mysql datadir = /usr/local/mysql/data2 EOF #mysql -S /tmp/mysql3306.sock mysql>GRANT SHUTDOWN ON . TO 'mysqladmin'@'localhost' identified by 'mysqladmin' with grant option; #mysql -S /tmp/mysql3307.sock mysql>GRANT SHUTDOWN ON . TO 'mysqladmin'@'localhost' identified by 'mysqladmin' with grant option;
启动mysql服务器:./mysqld_multi --defaults-file=/etc/my.f start 3306-3307
关闭mysql服务器:mysqladmin shutdown
以上所述是长沙网络推广给大家介绍了四种Mysql启动方式,希望对大家有所帮助!
编程语言
- 甘肃哪有关键词排名优化购买方式有哪些
- 甘肃SEO如何做网站优化
- 河南seo关键词优化怎么做电话营销
- 北京SEO优化如何做QQ群营销
- 来宾百度关键词排名:提升您网站曝光率的关键
- 卢龙关键词优化:提升您网站排名的策略与技巧
- 山东网站优化的注意事项有哪些
- 四川整站优化怎样提升在搜索引擎中的排名
- 疏附整站优化:提升网站性能与用户体验的全新
- 海南seo主要做什么工作售后服务要做到哪些
- 荣昌百度网站优化:提升您网站的搜索引擎排名
- 河北seo网站排名关键词优化如何做SEO
- 江西优化关键词排名推广售后保障一般有哪些
- 古浪SEO优化:提升你的网站可见性
- 西藏网站排名优化怎么把网站排名在百度首页
- 如何提升阳东百度快照排名:详尽指南