Detailed explanation of MySQL instance with SSD storage enabled Sometimes slow OS read and write operations can degrade MySQL server performance, especially when the OS and MySQL use the same disk. Therefore, it is best to let MySQL use a separate disk, preferably an SSD. To do this, you need to mount the new SSD disk to the server, assuming the new disk is at /dev/sdb. 1. Prepare a new disk: # fdisk /dev/sdb Pressing 'n' will create a new partition; pressing 'p' will create a new primary partition. Then set the partition number (from 1 to 4), select the partition size, and press Enter. If you do not want to use the entire disk as a partition, you still need to continue creating new partitions. Press "w" to write the changes. 2. Create a file system on a new partition # mkfs.ext4 /dev/sdb1 3. Map the new partition to a directory. I named it "ssd" in the root directory. # mkdir /ssd/ # mount /dev/sdb1 /ssd/ 4. Make this mapping effective when the server starts Modify the configuration file /etc/fstab /dev/sdb1 /ssd ext4 defaults 0 0 5. Move MySQL to the new disk Stop the MySQL service first # service mysqld stop If the system has a MySQL service, stop it, for example # service httpd stop # service nginx stop Copy the entire MySQL directory to the new disk # cp /var/lib/mysql /ssd/ -Rp After the copy is complete, rename the MySQL directory # mv /var/lib/mysql /var/lib/mysql-backup Next, create a symbolic link # ln -s /ssd/mysql /var/lib/mysql Now you can start the MySQL service # service mysqld start # service httpd start # service nginx start If you have any questions, please leave a message or come to the community to discuss. Thank you for reading and I hope it can help you. Thank you for your support of this site! You may also be interested in:
|
<<: React sample code to implement automatic browser refresh
>>: Detailed configuration of wireless network card under Ubuntu Server
Port mapping is not the only way to connect Docke...
The layout problem of irregular picture walls enc...
Introduction Because JavaScript is single-threade...
1. Check the software installation path: There is...
This question is very strange, so I will go strai...
Table of contents 1. Modify the app.vue page 2. C...
Table of contents 1. The reason why the limit is ...
Service.xml The Server.xml configuration file is ...
Preface The Boost library is a portable, source-c...
The MERGE storage engine treats a group of MyISAM...
A major feature of the WeChat 8.0 update is the s...
How is Line-height inherited?Write a specific val...
1. Dynamic parameters Starting from 2.6.0, you ca...
Preface In terms of layout, Gobang is much simple...
Sprites: In the past, each image resource was an ...