开发者

Why do i have debian-sys-maint instead of a mysql root user?

开发者 https://www.devze.com 2023-02-09 02:36 出处:网络
I am currently trying to get mysql setup and i was trying to recover the password because i didnt know my root password and i got these directions

I am currently trying to get mysql setup and i was trying to recover the password because i didnt know my root password and i got these directions

sudo /etc/init.d/mysql stop
sudo mysqld --skip-grant-tables &
mysql -u root mysql
 mysql>UPDATE user SET Password=PASSWORD('PASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit;
 sudo开发者_高级运维 killall mysqld
 sudo /etc/init.d/mysql start

the problem is whwn i log into the mysql i notice that when i do

 mysql> select * from user;

i only have 1 user that is debian-sys-maint, So how do i not have a root user and how do i create one with a password


MySQL is using pluggable authentication. It means that there could be users allowed to connect even if they are not in users table. So if you have default installation of MySQL in Ubuntu, just connect as root with root's password. MySQL will use Linux's authentication to check for password. Neverthel "resetting permissions". And concerning the debian-sys-maint user, read this answer on serverfault.

0

精彩评论

暂无评论...
验证码 换一张
取 消