mysql 启动 1067_MySQL启动提示1067 错误的解决

今天在重新安装MySQL服务的时候遇到如下错误:

C:\Program Files\MySQL\MySQL Server 4.1\bin>MySQLd-nt --remove

Service successfully removed.

C:\Program Files\MySQL\MySQL Server 4.1\bin>MySQLd-nt --install

Service successfully installed.

C:\Program Files\MySQL\MySQL Server 4.1\bin>net start MySQL

The MySQL service is starting.

The MySQL service could not be started.

A system error has occurred.

System error 1067 has occurred.

The process terminated unexpectedly.

发现一种最简单的方法:把MySQL目录下的my.ini copy到C:\WINDOWS中,再重新安装服务问题解决:

C:\Program Files\MySQL\MySQL Server 4.1>copy my.ini c:\WINDOWS\

1 file(s) copied.

C:\Program Files\MySQL\MySQL Server 4.1>MySQLd-nt --remove

Service successfully removed.

C:\Program Files\MySQL\MySQL Server 4.1>MySQLd-nt --install

Service successfully installed.

C:\Program Files\MySQL\MySQL Server 4.1>net start MySQL

The MySQL service is starting.

The MySQL service was started successfully.

网上有人给出了另外一个解决方法,比较麻烦,相信也是可行的:

把MySQL目录copy到c:\MySQL

copy my.ini到C:\WINDOWS目录

修改my.ini中basedir和datadir参数

重新install MySQL service

谁不嫌麻烦可以试一下。0b1331709591d260c1c78e86d0c51c18.png

7月 11 10:15:09 zhang-virtual-machine systemd[1]: Starting MySQL Community Server... zhang@zhang-virtual-machine:~$ journalctl -xeu mysql.service ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ An ExecStart= process belonging to unit mysql.service has exited. ░░ ░░ The process' exit code is 'exited' and its exit status is 1. 7月 11 10:16:07 zhang-virtual-machine systemd[1]: mysql.service: Failed with result 'exit-code'. ░░ Subject: Unit failed ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ The unit mysql.service has entered the 'failed' state with result 'exit-code'. 7月 11 10:16:07 zhang-virtual-machine systemd[1]: Failed to start MySQL Community Server. ░░ Subject: A start job for unit mysql.service has failed ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ A start job for unit mysql.service has finished with a failure. ░░ ░░ The job identifier is 11397 and the job result is failed. 7月 11 10:16:07 zhang-virtual-machine systemd[1]: mysql.service: Scheduled restart job, restart counter is at 48. ░░ Subject: Automatic restarting of a unit has been scheduled ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ Automatic restarting of the unit mysql.service has been scheduled, as the result for ░░ the configured Restart= setting for the unit. 7月 11 10:16:07 zhang-virtual-machine systemd[1]: Stopped MySQL Community Server. ░░ Subject: A stop job for unit mysql.service has finished ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ A stop job for unit mysql.service has finished. ░░ ░░ The job identifier is 11470 and the job result is done. 7月 11 10:16:07 zhang-virtual-machine systemd[1]: Starting MySQL Community Server... ░░ Subject: A start job for unit mysql.service has begun execution ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ A start job for unit mysql.service has begun execution. ░░ ░░ The job identifier is 11470. lines 2126-2168/2168 (END)
最新发布
07-12
根据日志显示,MySQL服务的启动失败并出现了错误代码1。这可能是由于配置文件中的错误、权限问题、数据库文件损坏或其他原因导致的。 以下是一些解决此问题的常见步骤: 1. 检查MySQL配置文件(通常位于/etc/mysql/mysql.conf.d目录下)是否存在任何语法错误或配置问题。可以尝试使用命令`sudo mysqld --verbose --help`来检查配置文件是否有问题。 2. 确保MySQL所需的目录和文件的权限设置正确。通常,MySQL的数据目录位于/var/lib/mysql,并且应该由mysql用户拥有。您可以使用`sudo chown -R mysql:mysql /var/lib/mysql`命令来更正权限问题。 3. 检查MySQL数据库文件是否被损坏。您可以尝试使用`mysqlcheck`命令来检查和修复数据库文件。例如,可以运行`sudo mysqlcheck --all-databases --fast`来检查所有数据库。 4. 查看系统日志以获取更详细的错误信息。可以使用`journalctl -xeu mysql.service`命令来查看MySQL服务的日志。 5. 如果以上步骤都没有解决问题,您可以尝试重新安装MySQL服务器。可以使用以下命令来卸载和重新安装MySQL: - `sudo apt-get remove --purge mysql-server mysql-client mysql-common` - `sudo apt-get autoremove` - `sudo apt-get autoclean` - `sudo apt-get install mysql-server` 请注意,重新安装MySQL可能会导致数据丢失,请确保提前备份重要的数据库文件。 希望这些步骤能够帮助您解决问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值