我是Ubuntu的新手.我正在运行Ubuntu 12.10.我正在尝试安装apache,php,mysql.但是我已经安装了apache并且运行正常.
sudo apt-get install apache2
但是当我尝试使用以下命令安装mysql时
sudo apt-get install mysql-server
下载后,它要求输入密码,但输入并确认密码后.我收到以下错误消息.
Unable to set password for the Mysql "root" user An error occurred while setting password for the mysql administrative user.This may have happened because the account already has a password, or because of a communication problem with the Mysql server. You should check the account's password after the package installation. Please read the /usr/share/doc/mysql-server-5.5/README.Debian file for more information.
点击提示上的确定按钮后,我在终端上收到以下消息
Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
mysql-server-5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)
Mysql错误日志说
130209 14:26:37 [Note] Plugin 'FEDERATED' is disabled.
130209 14:26:37 InnoDB: The InnoDB memory heap is disabled
130209 14:26:37 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130209 14:26:37 InnoDB: Compressed tables use zlib 1.2.7
130209 14:26:37 InnoDB: Using Linux native AIO
mysqld: Can't create/write to file '/tmp/ibNuz7q0' (Errcode: 13)
130209 14:26:37 InnoDB: Error: unable to create temporary file; errno: 13
130209 14:26:37 [ERROR] Plugin 'InnoDB' init function returned error.
130209 14:26:37 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
130209 14:26:37 [ERROR] Unknown/unsupported storage engine: InnoDB
130209 14:26:37 [ERROR] Aborting
我已经搜索过这个问题了,但没有什么对我有用.请帮忙.
解决方法:
这里的root密码设置问题相同,可能是由于以前手动安装mysql server 5.6失败造成的.彻底的mysql卸载绝非易事.我清洗/重新安装了几个小时,然后终于解决了它
sudo dpkg --purge mysql-client-core-5.5 # or alternative version
sudo dpkg --purge mysql-client
sudo dpkg --purge mysql-server-core-5.5 # or alternative version
sudo dpkg --purge mysql-common
基本上我只是打字
sudo dpkg --purge mysql # followed by two tabs
然后 – 清除终端自动完成的任何包.最后清除mysql-common因为一些依赖性问题.
除了之外,还可以使用上面的dpkg命令
sudo apt-get --purge remove mysql-server
sudo apt-get --purge remove mysql-client
sudo apt-get --purge remove mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
我也试过Greq的方法
sudo rm -rf /etc/mysql
从/ var / lib中删除mysql文件夹
sudo rm -rf /var/lib/mysql/
此时,为了确保完全删除mysql,请检查
which mysql
mysql --version
第一个应该不返回输出而不是文件夹.第二个应该返回没有安装mysql而不是版本号.否则删除仍然不完整.
dpkg –purge的意义在于,当单独使用apt-get时,mysql和mysql –version的行为就像mysql一样.
在重新安装之前,请重新配置dpkg并进行更新
sudo dpkg --configure -a
sudo apt-get update
问题终于解决了.希望它对其他人有所帮助.