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
Table of contents As attribute and property value...
jQuery realizes the effect of theater seat select...
Summarize This article ends here. I hope it can b...
Table of contents Preface Detect Zookeeper servic...
When the jsp that is jumped to after the struts2 a...
Preface After reading the previous article about ...
This article shares the specific code of jQuery t...
Related system calls for file operations create i...
<br />I have compiled some domestic design w...
Preface We know that index selection is the work ...
Today I will share with you a neon button animati...
background When you open the product details on s...
Vue parent component calls the function of the ch...
Table of contents 0x01 Failed to load the driver ...
Table of contents 1. Deconstruction Tips 2. Digit...