lunes, 29 de julio de 2019

Error de phpMyAdmin -> error #1698 phpmyadmin “Access denied for user 'root'@'localhost'”

Error

#1698 Access denied for user 'root'@'localhost'

mysqli_real_connect(): (HY000/1698): Access denied for user 'root'@'localhost'


Solución

sudo mysql -p -u root

CREATE USER 'newuser'@'%' IDENTIFIED BY 'you_password_here';
RESULTADO: Query OK, 0 rows affected (0.00 sec)

GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'%' WITH GRANT OPTION;
RESULTADO: Query OK, 0 rows affected (0.01 sec)


Reiniciar contraseña del ROOT para MYSQL

Error:

https://royfix.blogspot.com/2019/07/error-mysql-mysqldsafe-directory.html

Solución:

Ubuntu y Debian
sudo /etc/init.d/mysql stop
sudo service mysql stop

CentOS, Fedora y Red Hat Enterprise Linux
sudo /etc/init.d/mysqld stop

sudo mysqld_safe --skip-grant-tables &

Iniciar en otra pestaña o terminal:

mysql -uroot

use mysql;

update user set authentication_string=PASSWORD("mynewpassword") where User='root';
update user set plugin="mysql_native_password";


flush privileges;

quit

Iniciar de nuevo el servicio

sudo service mysql stop
sudo service mysql start

sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql start

Error MYSQL -> mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists

Error:

2017-02-10T17:05:44.870970Z mysqld_safe Logging to '/var/log/mysql/error.log'.
2017-02-10T17:05:44.872874Z mysqld_safe Logging to '/var/log/mysql/error.log'.
2017-02-10T17:05:44.874547Z mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists.

Solución:

mkdir -p /var/run/mysqld
chown mysql:mysql /var/run/mysqld

https://royfix.blogspot.com/2019/07/reset-mysql-root-password.html