开发者社区> 问答> 正文

ubuntu 12.04 lts 安装 Mysql 报错,求助?报错

我之前应该是装过mysql,忘记为什么删掉了(或者就没装过

然后现在是需要装数据库,之前装 mariadb 不行[见http://www.oschina.net/question/86241_118016],于是试试 mysql 能安装不,结果也是碰到好多错误,记录下来如下。

安装之前先清理:

#清理安装
sudo apt-get purge mysql* mariadb* && apt-get clean && apt-get autoremove

#删除 mysql 用户 
userdel -r mysql

#查找遗留的文件
find / -name mysql*

#删除遗留文件
rm -Rf /etc/mysql* /var/lib/mysql* /var/log/mysql* /run/mysql*
然后执行安装,报错信息如下:

Unable to set password for the MySQL "root" user                                   .│                                                                                    .│ An error occurred while setting the 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.  ┌─────────────────────────┤ Configuring mysql-server-5.5   .│                                                                                    .│ Unable to set password for the MySQL "root" user                                   .│                                                                                    .│ An error occurred while setting the 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.                                                                       .│                                                                                    .│                                      <Ok>                                          .│                                                                                    .└─────────────────────────────────────────  ─  

日志如下:

# sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libdbd-mysql-perl libmariadbclient18 libmysqlclient18 mariadb-common
  mysql-client-5.5 mysql-client-core-5.5 mysql-common mysql-server-5.5
  mysql-server-core-5.5
Suggested packages:
  tinyca mailx
The following NEW packages will be installed:
  libdbd-mysql-perl libmariadbclient18 libmysqlclient18 mariadb-common
  mysql-client-5.5 mysql-client-core-5.5 mysql-common mysql-server mysql-server-5.5
  mysql-server-core-5.5
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 25.5 MB of archives.
After this operation, 89.2 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/main libdbd-mysql-perl i386 4.020-1build2 [104 kB]
Get:2 http://mirrors.ustc.edu.cn/mariadb/repo/5.5/ubuntu/ precise/main mysql-common all 5.5.31+maria-1~precise [8,790 B]
Get:3 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main mysql-client-core-5.5 i386 5.5.31-0ubuntu0.12.04.2 [1,863 kB]
Get:4 http://mirrors.ustc.edu.cn/mariadb/repo/5.5/ubuntu/ precise/main mariadb-common all 5.5.31+maria-1~precise [3,272 B]
Get:5 http://mirrors.ustc.edu.cn/mariadb/repo/5.5/ubuntu/ precise/main libmariadbclient18 i386 5.5.31+maria-1~precise [840 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main mysql-client-5.5 i386 5.5.31-0ubuntu0.12.04.2 [8,096 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main mysql-server-core-5.5 i386 5.5.31-0ubuntu0.12.04.2 [5,835 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main mysql-server-5.5 i386 5.5.31-0ubuntu0.12.04.2 [8,746 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main mysql-server all 5.5.31-0ubuntu0.12.04.2 [11.3 kB]
Get:10 http://mirrors.ustc.edu.cn/mariadb/repo/5.5/ubuntu/ precise/main libmysqlclient18 i386 5.5.31+maria-1~precise [2,932 B]
Fetched 25.5 MB in 13s (1,926 kB/s)                                                   
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 89679 files and directories currently installed.)
Unpacking mysql-common (from .../mysql-common_5.5.31+maria-1~precise_all.deb) ...
Selecting previously unselected package mariadb-common.
Unpacking mariadb-common (from .../mariadb-common_5.5.31+maria-1~precise_all.deb) ...
Selecting previously unselected package libmariadbclient18.
Unpacking libmariadbclient18 (from .../libmariadbclient18_5.5.31+maria-1~precise_i386.deb) ...
Selecting previously unselected package libmysqlclient18.
Unpacking libmysqlclient18 (from .../libmysqlclient18_5.5.31+maria-1~precise_i386.deb) ...
Selecting previously unselected package libdbd-mysql-perl.
Unpacking libdbd-mysql-perl (from .../libdbd-mysql-perl_4.020-1build2_i386.deb) ...
Selecting previously unselected package mysql-client-core-5.5.
Unpacking mysql-client-core-5.5 (from .../mysql-client-core-5.5_5.5.31-0ubuntu0.12.04.2_i386.deb) ...
Selecting previously unselected package mysql-client-5.5.
Unpacking mysql-client-5.5 (from .../mysql-client-5.5_5.5.31-0ubuntu0.12.04.2_i386.deb) ...
Selecting previously unselected package mysql-server-core-5.5.
Unpacking mysql-server-core-5.5 (from .../mysql-server-core-5.5_5.5.31-0ubuntu0.12.04.2_i386.deb) ...
Processing triggers for man-db ...
Setting up mysql-common (5.5.31+maria-1~precise) ...
Selecting previously unselected package mysql-server-5.5.
(Reading database ... 89873 files and directories currently installed.)
Unpacking mysql-server-5.5 (from .../mysql-server-5.5_5.5.31-0ubuntu0.12.04.2_i386.deb) ...
Selecting previously unselected package mysql-server.
Unpacking mysql-server (from .../mysql-server_5.5.31-0ubuntu0.12.04.2_all.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up mariadb-common (5.5.31+maria-1~precise) ...
Setting up mysql-client-core-5.5 (5.5.31-0ubuntu0.12.04.2) ...
Setting up mysql-server-core-5.5 (5.5.31-0ubuntu0.12.04.2) ...
Setting up libmysqlclient18 (5.5.31+maria-1~precise) ...
Setting up libdbd-mysql-perl (4.020-1build2) ...
Setting up mysql-client-5.5 (5.5.31-0ubuntu0.12.04.2) ...
Setting up mysql-server-5.5 (5.5.31-0ubuntu0.12.04.2) ...
130712 16:08:57 [Note] Plugin 'FEDERATED' is disabled.
130712 16:08:57 InnoDB: The InnoDB memory heap is disabled
130712 16:08:57 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130712 16:08:57 InnoDB: Compressed tables use zlib 1.2.3.4
130712 16:08:57 InnoDB: Initializing buffer pool, size = 256.0M
130712 16:08:58 InnoDB: Completed initialization of buffer pool
130712 16:08:58 InnoDB: highest supported file format is Barracuda.
130712 16:08:58  InnoDB: Waiting for the background threads to start
130712 16:08:59 InnoDB: 5.5.31 started; log sequence number 1595675
130712 16:08:59 [ERROR] /usr/sbin/mysqld: unknown variable 'log_slow_verbosity=query_plan'
130712 16:08:59 [ERROR] Aborting

130712 16:08:59  InnoDB: Starting shutdown...
130712 16:08:59  InnoDB: Shutdown completed; log sequence number 1595675
130712 16:08:59 [Note] /usr/sbin/mysqld: Shutdown complete

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
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.
dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
Setting up libmariadbclient18 (5.5.31+maria-1~precise) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                   Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
 mysql-server-5.5
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
求助啊,应该怎么办啊?我还不想重装系统啊

展开
收起
爱吃鱼的程序员 2020-06-22 18:25:31 1014 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    不知道啊~下个压缩包然后自己编译安装试试~??实在不行我再试试这个。谢谢试试这个,有个人跟你的错误一模一样 <arel="nofollow">http://askubuntu.com/questions/253023/unable-to-set-password-for-the-mysql-root-user谢谢,我稍后去试试,最近没法操作我昨天刚给新同事弄环境。开始也是mysql装不上,后来发现原来尝试装过mariadb,不过都没有撞上,然后我就各种卸载,各种重装。最后得出一个道理,就是直接安装mariadb依赖搞不定,要先安装mysql然后再装。mysql装不上就先删掉点关于mysql的残余东西试试吧。呵呵问题是现在mysql都装不上了,头疼

    2020-06-22 18:25:49
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
搭建电商项目架构连接MySQL 立即下载
搭建4层电商项目架构,实战连接MySQL 立即下载
PolarDB MySQL引擎重磅功能及产品能力盛大发布 立即下载