mysql:无法为MySQL设置密码" root"用户

时间:2016-08-28 06:24:49

标签: mysql ubuntu server install

我尝试在Ubuntu 14.4服务器上安装MySQL,网上有很多指南。 但是在MySQL安装过程中遇到了这个问题:

Setting up libdbd-mysql-perl (4.025-1) ...
Setting up mysql-client-5.6 (5.6.31-0ubuntu0.14.04.2) ...
Setting up mysql-server-5.6 (5.6.31-0ubuntu0.14.04.2) ...
2016-08-28 10:45:19 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-08-28 10:45:19 0 [Note] /usr/sbin/mysqld (mysqld 5.6.31-0ubuntu0.14.04.2-log) starting as process 4394 ...
2016-08-28 10:45:19 4394 [Warning] Using unique option prefix myisam_recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
2016-08-28 10:45:19 4394 [Note] Plugin 'FEDERATED' is disabled.
2016-08-28 10:45:19 4394 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-08-28 10:45:19 4394 [Note] InnoDB: The InnoDB memory heap is disabled
2016-08-28 10:45:19 4394 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-08-28 10:45:19 4394 [Note] InnoDB: Memory barrier is not used
2016-08-28 10:45:19 4394 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-08-28 10:45:19 4394 [Note] InnoDB: Using Linux native AIO
2016-08-28 10:45:19 4394 [Note] InnoDB: Using CPU crc32 instructions
2016-08-28 10:45:19 4394 [Note] InnoDB: Initializing buffer pool, size = 256.0M
2016-08-28 10:45:19 4394 [Note] InnoDB: Completed initialization of buffer pool
2016-08-28 10:45:19 4394 [Note] InnoDB: Highest supported file format is Barracuda.
2016-08-28 10:45:19 4394 [Note] InnoDB: 128 rollback segment(s) are active.
2016-08-28 10:45:19 4394 [Note] InnoDB: Waiting for purge to start
2016-08-28 10:45:19 4394 [Note] InnoDB: 5.6.31 started; log sequence number 2535999
2016-08-28 10:45:19 4394 [ERROR] /usr/sbin/mysqld: unknown variable 'log_slow_verbosity=query_plan'
2016-08-28 10:45:19 4394 [ERROR] Aborting
2016-08-28 10:45:19 4394 [Note] Binlog end
2016-08-28 10:45:19 4394 [Note] InnoDB: FTS optimize thread exiting.
2016-08-28 10:45:19 4394 [Note] InnoDB: Starting shutdown...
2016-08-28 10:45:21 4394 [Note] InnoDB: Shutdown completed; log sequence number 2536009
2016-08-28 10:45:21 4394 [Note] /usr/sbin/mysqld: Shutdown complete
Package configuration

然后显示此错误:

  

为MySQL管理用户设置密码时发生错误。这可能是因为帐户已经有密码,或者是因为MySQL服务器存在通信问题。

     

您应该在安装软件包后检查帐户的密码。请阅读/usr/share/doc/mysql-server-5.6/README.Debian文件以获取更多信息。

2 个答案:

答案 0 :(得分:1)

尝试了很多东西。检查错误日志vim /var/log/mysql/error.log并找出/ tmp文件夹的持久性问题。将权限更改为777,卸载然后重新安装。像魅力一样工作

答案 1 :(得分:0)

也许,作为follong教程的结果,你搞砸了配置文件。

我建议您完成卸载软件包

apt-get remove --purge mysql-server
apt-get remove --purge mysql-common

然后确保/etc/mysql/my.cnf不存在。 然后重新安装

apt-get install mysql-server