在Ubuntu 12.0.4 LTS上通过apt-get安装Mysql并搞乱它后,我处于没有帐户的位置,可以执行任何操作来授予权限或创建新用户。
我只能通过
连接到它mysql --defaults-file = / etc / mysql / debian.cnf
select host,user ,select_priv, Create_user_priv from mysql.user;
返回下表:
+-----------+------------------+-------------+------------------+
| host | user | select_priv | Create_user_priv |
+-----------+------------------+-------------+------------------+
| localhost | apsc | N | N |
| localhost | pma_GSn1wBscFLp0 | N | N |
| localhost | pp_sb_db | N | N |
| localhost | debian-sys-maint | Y | Y |
| localhost | admin | N | N |
| localhost | pma_FoXErUK90AbF | N | N |
+-----------+------------------+-------------+------------------+
如何创建具有所有权限的root用户?完全重置对我没问题。
以下命令仅返回access denied
错误
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION