简体   繁体   English

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

[英]mysql : Unable to set password for the MySQL “root” user

I tried to install MySQL on Ubuntu 14.4 Server with many guides on the web. 我尝试通过网络上的许多指南在Ubuntu 14.4 Server上安装MySQL。 but during MySQL installation by all of ways encountered this problem: 但是在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

And then show this error: 然后显示此错误:

An error occurred while setting the password for the MySQL administrative user. 设置MySQL管理用户的密码时发生错误。 This may have happened because the account already has a password, or because of a communication problem with the MySQL server. 这可能是由于该帐户已经有密码,或者是由于与MySQL服务器的通讯问题而发生的。

You should check the account's password after the package installation. 安装软件包后,您应该检查帐户的密码。 Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more information. 请阅读/usr/share/doc/mysql-server-5.6/README.Debian文件以获取更多信息。

Tried a lot of stuff. 尝试了很多东西。 Checked the error log vim /var/log/mysql/error.log and found out issue with persmissions of the /tmp folder. 检查了错误日志vim /var/log/mysql/error.log,并发现了/ tmp文件夹权限的问题。 Changed the permissions to 777 , uninstalled and then re-installed. 将权限更改为777,已卸载然后重新安装。 Works like a charm 奇迹般有效

Perhaps, as a result of follong tutorials you messed up the configuration files. 也许,由于进行了后续教程,您弄乱了配置文件。

I recommend you to complete unsinstall the package 我建议您完成卸载程序包

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

Then assure that /etc/mysql/my.cnf does not exist. 然后确保/etc/mysql/my.cnf不存在。 Then install again 然后重新安装

apt-get install mysql-server

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM