Главная » Статьи » Linux |
Mysql 5.7 change password on authentication_string Link to bash script: https://gist.github.com/iamsimakov/040bfaab263b8dd051569b65857ab431 ex output username@alexey-host:~$ sudo killall mysqld_safe username@alexey-host:~$ mysql -u root Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> use mysql; Database changed mysql> update user set plugin="mysql_native_password"; mysql> \q
Bash script: #!/bin/bash
function log { echo $@ }
function stop_mysql_server { log 'Stopping' sleep 2 sudo /etc/init.d/mysql stop sleep 2 sudo killall mysqld_safe sleep 2 sudo killall mysqld sleep 2 }
function mkdir_sock_mysql { log 'Make dir /var/run/mysqld' sudo mkdir -p /var/run/mysqld sudo chown mysql. -R /var/run/mysqld sudo chmod 0755 /var/run/mysqld sleep 1 }
function start_mysql_skip_grant { log 'Start skip grant' sudo mysqld_safe --skip-grant-tables & sleep 5 }
function exec_query { log $@ mysql -u root mysql -e $@ }
function start_mysql { log 'Start mysql' sudo /etc/init.d/mysql start }
stop_mysql_server mkdir_sock_mysql start_mysql_skip_grant exec_query "update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';" stop_mysql_server start_mysql
Источник: http://askubuntu.com/questions/705458/ubuntu-15-10-mysql-error-1524-unix-socket | |
Просмотров: 1120 | |
Всего комментариев: 0 | |