# access denied after mysql\_install\_db --user=mysql

**URL:** https://forums.percona.com/t/access-denied-after-mysql-install-db-user-mysql/3367
**Category:** Other MySQL® Questions
**Created:** [March 27, 2014, 2:54am UTC](https://forums.percona.com/t/access-denied-after-mysql-install-db-user-mysql/3367 "2014-03-27T02:54:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![salos](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@salos](https://forums.percona.com/u/salos)
#### Post date: [March 27, 2014, 2:54am UTC](https://forums.percona.com/t/access-denied-after-mysql-install-db-user-mysql/3367/1 "2014-03-27T02:54:15Z")

</div>

I had mysql data dir on separate hdd. And yesterday this hdd died.The hdd was replaced and I was trying to restore from backup. However it was not successfull.  
Moreover I cannot start mysql from clean db.  
I removed all files from /var/lib/mysql data dir and then run

mysql\_install\_db --user=mysql

but after start mysql

service mysql restart

I have strange error  
Stopping MySQL database server: mysqld.  
Starting MySQL database server: mysqld …  
Checking for corrupt, not cleanly closed and upgrade needing tables…  
root@c-a060-u1769-142:/var/lib/mysql# ERROR 1045 (28000): Access denied for user ‘debian-sys-maint’@‘localhost’ (using password: YES)

but I don’t request login to mysql just start daemon.

mysql error log

140327 08:10:39 mysqld\_safe Starting mysqld daemon with databases from /var/lib/mysql/  
2014-03-27 08:10:39 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit\_defaults\_for\_timestamp server option (see documentation for more details).  
2014-03-27 08:10:39 32593 [Warning] Using unique option prefix myisam\_recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.  
2014-03-27 08:10:39 32593 [Note] Plugin ‘FEDERATED’ is disabled.  
2014-03-27 08:10:39 32593 [Note] InnoDB: The InnoDB memory heap is disabled  
2014-03-27 08:10:39 32593 [Note] InnoDB: Mutexes and rw\_locks use GCC atomic builtins  
2014-03-27 08:10:39 32593 [Note] InnoDB: Compressed tables use zlib 1.2.3  
2014-03-27 08:10:39 32593 [Note] InnoDB: Using Linux native AIO  
2014-03-27 08:10:39 32593 [Note] InnoDB: Using CPU crc32 instructions  
2014-03-27 08:10:39 32593 [Note] InnoDB: Initializing buffer pool, size = 8.0G  
2014-03-27 08:10:39 32593 [Note] InnoDB: Completed initialization of buffer pool  
2014-03-27 08:10:39 32593 [Note] InnoDB: Highest supported file format is Barracuda.  
2014-03-27 08:10:40 32593 [Note] InnoDB: 128 rollback segment(s) are active.  
2014-03-27 08:10:40 32593 [Note] InnoDB: Waiting for purge to start  
2014-03-27 08:10:40 32593 [Note] InnoDB: Percona XtraDB ([http://www.percona.com](http://www.percona.com)) 5.6.14-rel62.0 started; log sequence number 1628787  
2014-03-27 08:10:40 32593 [Note] RSA private key file not found: /var/lib/mysql//private\_key.pem. Some authentication plugins will not work.  
2014-03-27 08:10:40 32593 [Note] RSA public key file not found: /var/lib/mysql//public\_key.pem. Some authentication plugins will not work.  
2014-03-27 08:10:40 32593 [Note] Server hostname (bind-address): ‘127.0.0.1’; port: 3306  
2014-03-27 08:10:40 32593 [Note] - ‘127.0.0.1’ resolves to ‘127.0.0.1’;  
2014-03-27 08:10:40 32593 [Note] Server socket created on IP: ‘127.0.0.1’.  
2014-03-27 08:10:40 32593 [Note] Event Scheduler: Loaded 0 events  
2014-03-27 08:10:40 32593 [Note] /usr/sbin/mysqld: ready for connections.  
Version: ‘5.6.14-62.0-log’ socket: ‘/var/run/mysqld/mysqld.sock’ port: 3306 Percona Server (GPL), Release 62.0

I’m using percona server 5.6

---

<div class="post-metadata">

### Author: ![niljoshi](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/niljoshi/32/16889_2.png) [@niljoshi](https://forums.percona.com/u/niljoshi)
#### Post date: [March 31, 2014, 6:50am UTC](https://forums.percona.com/t/access-denied-after-mysql-install-db-user-mysql/3367/2 "2014-03-31T06:50:03Z")

</div>

Hi,

In Debian, It has a MySQL account debian-sys-maint used for switching on/off and checking status. The password for that user should be the same as stored in /etc/mysql/debian.cnf. so if your server has not account like debian-sys-maint then create the user with password mentioned in /etc/mysql/debian.cnf and try again.  
i.e  
mysql\> GRANT ALL PRIVILEGES ON _._ TO ‘debian-sys-maint’@‘localhost’ IDENTIFIED BY ‘password’;
