XAMPP set root user password for MariaDB

不打扰是莪最后的温柔 提交于 2019-12-12 04:52:49

问题


How do you set the root user password for MariaDB in XAMPP on Ubuntu/Kubuntu 16.04?

By default the root user does not have a password set.

I'm using XAMPP 7.1.11


回答1:


I managed to do it on both Windows and Linux. On Windows, open command prompt, change directory to \xampp\mysql\bin and use mysqladmin to set password for root user i.e.

cd \xampp\mysql\bin
mysqladmin --user=root password "your_password"

On Linux (Ubuntu/Kubuntu), open terminal emulator and change directory to /opt/lampp/bin i.e.

cd /opt/lampp/bin
./mysqladmin --user=root password "your_password"



回答2:


I had the same problem fixed it like this:

sudo mysqld_safe --skip-grant-tables &
mysql -u root
use mysql;
update user set password=PASSWORD("mynewpassword") where User='root';
update user set plugin="mysql_native_password";
quit;

Restart the database and you are good.

Key was this line:

update user set plugin="mysql_native_password";


来源:https://stackoverflow.com/questions/48160663/xampp-set-root-user-password-for-mariadb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!