Many times, mysql data will be very large, the data is placed in /var/lib/mysql by default, because /var is not enough space, so we need to modify the mysql data storage path Put it in a large partition so that you can cope with mysql data growth.
1. Set a new storage path
mkdir -p /data/mysql
2. Copy the original data cp -R /var/lib/mysql/* /Data/mysql
3. Modify the permission chown -R mysql:mysql /data/mysql
4. Modify the configuration file vi /etc/mysql/my.cnfdatadir = /data/mysql
5. Modify the startup file vi /etc/apparmor.d/usr.sbin.mysqld
#put /var/lib/mysql r, /var/lib/mysql/** rwk,< Br>
#Change to /data/mysql r, /data/mysql/** rwk,
6. Restart the service restart apparmor/etc/init.d/apparmor restart/etc/init.d /mysql restart
The modification is now complete.
Appendix:
Exporting the database and compressing: mysqldump -u root -p mysql |
Gzip > mysql.sql.gz
Unpack: gunzip mysql.sql.gz
import: source mysql.sql
or mysqldump -uroot -p dbname < dbname .sql;
If it can't be started, check LOG:tail -n 40 /var/log/syslog
Configure the MySQL configuration data separately, solve the problem of large space occupied by ibdata1 file
In todays increasingly prominent network security issues, how to ensure the security of Ubuntu syste
Linux has created a friendly environment that gives us the possibility to choose. For example, most
Introduction to Soft InterruptsInsert processing that can be deferred from the hard interrupt handl
I will talk about how to use the command in Linux to test the read and write input of the hard disk
Add and remove programs via three-party software in Linux
Linux operating system failure skills
Java in Chinese linux system folder appears Chinese garbled problem
How to test hard disk read and write speed in Linux
Linux handling of exceptions and interrupts
How to modify the Linux computer name
Realize linux and windows file transfer
Comparison of ext4 and ext3 under Linux
9 tips for power management in Windows 7
What is the sd card? What card is the sd card? What does the sd card mean?
Solve the bug that IE8 can't browse some wiki pages
Windows8 system native Microsoft Pinyin input method detailed
How to make the input of math formulas in Windows7 environment easier and faster
Explanation: When a segmentation error occurs, how does the Linux system generate the core file