Problem: The partition capacity of the data file stored by mysql is small and is currently full, causing mysql to be unable to connect.
Solution:
1. Delete unnecessary data in the partition, such as log files, etc. (cannot solve the fundamental problem)
2. Expand the capacity of a certain disk
3. Modify the data storage location
Steps to modify the data storage location:
1, View mysql Storage directory
##
#安装目录 --basedir=/usr #数据存储位置 --datadir=/home/mysqlData/mysql #用户 --user=mysql #日志 --log-error=/home/mysqlData/mysql/localhost.localdomain.err #端口 --port=3306
service mysql stop
mkdir /home/mysql chown -R mysql:mysql /home/mysqlData
cp -afir /var/lib/mysql /home/mysqlData
[client] port = 3306#修改后的目录 socket = /home/mysqlData/mysql/mysql.sock [mysqld] port = 3306default-storage-engine = InnoDB #默认存储引擎 lower_case_table_names = 1 #不区分大小写 max-connections=3000character_set_server=utf8 #修改后的目录 datadir=/home/mysqlData/mysql #修改后的目录 sock=/home/mysqlData/mysql/mysql.sock
mysql
vim /etc/init.d/mysql
7. Start the mysql service
service mysql start
The above is the detailed content of Example tutorial on modifying data files in mysql5.6.33. For more information, please follow other related articles on the PHP Chinese website!