windowns环境下,数据库运行之后,修改相关路径配置

需求背景:
Mysql数据库使用sqlyog导入*.sql文件的时候,报错:
Errcode: 28
Error occured at:2018-05-23 09:21:08
Line no.:82519330
Error Code: 3 - Error writing file 'C:\Windows\SERVIC~2\NETWOR~1\AppData\Local\Temp\MLA973.tmp' (Errcode: 28 - No space left on device)

解决方案:
系磁盘空间不足,清理掉当前目录下的temp目录中文件。
同时,可指定datadir和tmp目录到磁盘空间足够大的目录下,编辑my.ini文件:
#增加:
tmpdir=“D:/data/mysql_tmp”
修改my.ini配置文件后需重启生效。
或者不修改my.ini文件,启动数据库的时候增加参数“--tmpdir=' D:/data/mysql_tmp' ”等。


如果安装数据库时,数据库的数据目录放到了不合适的目录,数据库配置完毕启动后,又想修改相关路径,解决方案:
数据库的数据目录修改方法:
基本顺序:
  1. 准备好新的磁盘和文件夹,
  2. 拷贝ibdata等数据,
  3. 修改my.ini,
  4. 重启数据库

详细步骤:
1、先使用命令,查看当前数据路径配置情况,找到当前数据目录位置:
show variables like ' datadir';
Mysql数据库的数据目录当前情况如下图:

2、在D盘新建文件夹“mysql”,在mysql里新建文件夹“data”:

3、将数据库当前目录“C:\ProgramData\MySQL\MySQL Server 5.7\Data”下所有文件拷贝到“D:\Mysql\data\”下:

4、编辑my.ini配置文件,确保配置永久生效:
#增加
basedir="C:/Program Files/MySQL/MySQL Server 5.7/"
datadir="D:/Mysql/data/"
tmpdir="D:/Mysql/tmp_data/"


5、重启Mysql数据库
C:\Program Files\MySQL>cd C:\Program Files\MySQL\MySQL Server 5.7\bin
C:\Program Files\MySQL\MySQL Server 5.7\bin>mysqladmin shutdown -p123456 #默认是ODBC用户的密码,可使用-u -p参数指定其他有shutdown权限的用户
C:\Program Files\MySQL\MySQL Server 5.7\bin> mysqld   #启动数据库


6、再次使用命令,查看当前各路径配置情况,进行验证:
show variables like '%dir%';
结果如下:

tips:
linux还需要注意对目录授权
STDOUT: Error: line 1: RuntimeError: file C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages\maya\app\renderSetup\model\sceneObservable.py line 365: (kInvalidParameter): Argument is a NULL pointer 2023-07-23 19:44:36: 0: WARNING: Strict error checking on, ignoring the following unrecognized error or warning. If it is fatal, please email support@thinkboxsoftware.com with the error message. 2023-07-23 19:44:36: 0: STDOUT: Warning: line 1: Python callback failed 2023-07-23 19:44:36: 0: WARNING: Strict error checking on, ignoring the following unrecognized error or warning. If it is fatal, please email support@thinkboxsoftware.com with the error message. 2023-07-23 19:44:36: 0: STDOUT: Error: line 1: RuntimeError: file C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages\maya\app\renderSetup\model\sceneObservable.py line 365: (kInvalidParameter): Argument is a NULL pointer 2023-07-23 19:44:36: 0: WARNING: Strict error checking on, ignoring the following unrecognized error or warning. If it is fatal, please email support@thinkboxsoftware.com with the error message. 2023-07-23 19:44:36: 0: STDOUT: Warning: line 1: Python callback failed 2023-07-23 19:44:36: 0: WARNING: Strict error checking on, ignoring the following unrecognized error or warning. If it is fatal, please email support@thinkboxsoftware.com with the error message. 2023-07-23 19:44:36: 0: STDOUT: Error: line 1: RuntimeError: file C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages\maya\app\renderSetup\model\sceneObservable.py line 365: (kInvalidParameter): Argument is a NULL pointer 2023-07-23 19:44:36: 0: WARNING: Strict error checking on, ignoring the following unrecognized error or warning. If it is fatal, please email support@thinkboxsoftware.com with the error message. 2023-07-23 19:44:36: 0: STDOUT: Warning: line 1: Python callback failed 2023-07-23 19:44:36: 0: WARNING: Strict error checking on, ignoring the following unrecognized error or warning. If it is fatal, please email support@thinkboxsoftware.com with the error message. 2023-07-23 19:44:36: 0: STDOUT: Error: line 1: RuntimeError: file C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages\maya\app\renderSetup\model\sceneObservable.py line 365: (kInvalidParameter): Argument is a NULL pointer 2023-07-23 19:44:36: 0: WARNING: Strict error checking on, ignoring the following unrecognized error or warning. If it is fatal, please email support@thinkboxsoftware.com with the error message. 2023-07-23 19:44:36: 0: STDOUT: Warning: line 1: Python callback failed 2023-07-23 19:44:48: 0: WARNING: Strict error checking on, ignoring the following unrecognized error or warning. If it is fatal, please email support@thinkboxsoftware.com with the error message. 2023-07-23 19:44:48: 0: STDOUT: Error: line 17: Division by zero. 2023-07-23 19:44:48: 0: WARNING: Strict error checking on, ignoring the following unrecognized error or warning. If it is fatal, please email support@thinkboxsoftware.com with the error message. 2023-07-23 19:44:48: 0: STDOUT: Error: line 17: Division by zero.
最新发布
07-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值