In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The following content mainly brings you Mysql initialization data storage directory change handouts, the knowledge here is slightly different from books, are professional and technical personnel in the process of contact with users, summed up, has a certain experience sharing value, hope to bring help to the majority of readers.
Introduction: all the business of a company is deployed on the CentOS 6.5. the data is stored on 40G system disk and 100G data disk. Because I just came into contact with the server, I didn't pay much attention to it. After installing the database, the new product was tested online, but soon, the developer reported that there was something wrong with the database and the number of connections. After logging in, check the memory, disk, CPU and other basic information. Found that the 40G system disk still has 5G left, and then remembered that the data disk should not be mounted, and the database is installed in the RPM package, so initialization is the default. (this part should be solved before launch, but there is a problem to be solved in the current test.)
Default data directory of the database: / var/lib/mysql
Partition the 100g data disk, format and mount it, and add it to the boot auto-load file
Data directory to be changed: / data/mysql
Basic steps:
(1) stop the Mysql service
/ etc/init.d/mysql stop
(2) cut the contents of the / var/lib/mysql directory to / data/mysql
Mv / var/lib/mysql/ / data/ you need to pay attention to the problem that commands such as cp may change the default permissions.
(3) change the datadir directory of the configuration file my.cnf
Datadir=/data/mysql lower_case_table_names=1 skip-name-resolve character-set-server=utf8 wait_timeout=1800 interactive_timeout = 288000 max_allowed_packet = 1000m max_connections=3000 character-set-server=utf8 Innodb_buffer_pool_size = 1000m innodb_additional_mem_pool_size = 200Minnodb_flush_log_at_trx_commit=2 innodb_autoextend_increment=800M innodb_log_buffer_size = 200m # innodb_log_file_size = 100m key_buffer_size=800M read_buffer_size=600M thread_cache_size=64
(4) restart the service
For the above handouts on the change of data storage catalogue after Mysql initialization, if you have more information, you can continue to follow our industry promotion. If you need professional solutions, you can contact the pre-sales and after-sales ones on the official website. I hope this article can bring you some knowledge updates.
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.