简体   繁体   中英

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. but during MySQL installation by all of ways encountered this problem:

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. 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.6/README.Debian file for more information.

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. Changed the permissions to 777 , uninstalled and then re-installed. 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. Then install again

apt-get install mysql-server

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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