Version: Server version: 10.1.32-MariaDB
I have trouble setting a password in mysql o mariadb
use xampp 5.6
I install xampp I enter the console and with mysql -u root
log me in.
Following different examples that I have seen through different web pages I have tried different ways to change the key, every time I have uninstalled I have installed the xampp again.
Test 1:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('clave');
Test 2:
# mysqladmin -u root -p password clave
Enter password:
PC-CASA@DESKTOP-11KK10F c:\xampp
# mysql -u root -pclave
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.1.32-MariaDB mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> use mysql
Database changed
MariaDB [mysql]>
Trying either of the two ways if I access from the console or the workbench access perfectly, if I restart the mysql also accesses perfectly.
The problem comes when I load a *.sql
with 2 databases, the load is done correctly I see the tables and everything, but when I restart the mysql when trying to access again it throws me the error:
ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: YES)
Test
MariaDB [(none)]> ALTER USER 'root'@'localhost' IDENTIFIED BY 'clave';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'USER 'root'@'localhost' IDENTIFIED BY 'clave'' at line 1
MariaDB [(none)]>