In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
What this article shares to you is about the four ways to start MySQL. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article. Let's take a look at it.
There are four ways to start mysql:
1 、 mysqld
Start the mysql server:. / mysqld-- defaults-file=/etc/my.cnf-- user=root
Client connection:
Mysql-defaults-file=/etc/my.cnf
Or
Mysql-S / tmp/mysql.sock
2 、 mysqld_safe
Start the mysql server:. / mysqld_safe-- defaults-file=/etc/my.cnf-- user=root &
Client connection:
Mysql-defaults-file=/etc/my.cnf
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
Start the mysql server: service mysql.server {start | stop | restart | reload | force-reload | status}
Client connection: same as 1, 2
4 、 mysqld_multi
Mkdir $MYSQL_BASE/data2
Cat / etc/my.cnf
[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
Net_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
Net_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
Start the mysql server:. / mysqld_multi-- defaults-file=/etc/my.cnf start 3306-3307
Shut down the mysql server: mysqladmin shutdown
These are the four ways to start MySQL, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.