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启动方式,希望对大家有所帮助!
编程语言
- 如何快速学会编程 如何快速学会ug编程
- 免费学编程的app 推荐12个免费学编程的好网站
- 电脑怎么编程:电脑怎么编程网咯游戏菜单图标
- 如何写代码新手教学 如何写代码新手教学手机
- 基础编程入门教程视频 基础编程入门教程视频华
- 编程演示:编程演示浦丰投针过程
- 乐高编程加盟 乐高积木编程加盟
- 跟我学plc编程 plc编程自学入门视频教程
- ug编程成航林总 ug编程实战视频
- 孩子学编程的好处和坏处
- 初学者学编程该从哪里开始 新手学编程从哪里入
- 慢走丝编程 慢走丝编程难学吗
- 国内十强少儿编程机构 中国少儿编程机构十强有
- 成人计算机速成培训班 成人计算机速成培训班办
- 孩子学编程网上课程哪家好 儿童学编程比较好的
- 代码编程教学入门软件 代码编程教程