# Don't know root password for mysql

**URL:** <https://forum.core-electronics.com.au/t/dont-know-root-password-for-mysql/3992>\
**Category:** Raspberry Pi\
**Created:** [22 November 2018 23:52 UTC](https://forum.core-electronics.com.au/t/dont-know-root-password-for-mysql/3992 "2018-11-22T23:52:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Russell74506](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@Russell74506](https://forum.core-electronics.com.au/u/Russell74506)\
**Post date:** [22 November 2018 23:52 UTC](https://forum.core-electronics.com.au/t/dont-know-root-password-for-mysql/3992/1 "2018-11-22T23:52:44Z")

</div>

I installed mySQL using

```auto
sudo apt-get install mysql-server
sudo apt-get install python-mysqldb
 didn't notice any request for a password, perhaps I missed it as it took a long while. 
I cannot access mysql using
mysql -u root -p
as I don't have a password. Is there any way around this?
I thought of reinstalling it but it says it is already the latest version. 
How do I remove it so I can reinstall and avidly wait for the password prompt?
```

---

<div class="post-metadata">

**Author:** ![arb](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/arb/32/1265_2.png) [@arb](https://forum.core-electronics.com.au/u/arb)\
**Post date:** [23 November 2018 00:48 UTC](https://forum.core-electronics.com.au/t/dont-know-root-password-for-mysql/3992/2 "2018-11-23T00:48:47Z")

</div>

This may help: [https://www.techrepublic.com/article/how-to-set-change-and-recover-a-mysql-root-password/](https://www.techrepublic.com/article/how-to-set-change-and-recover-a-mysql-root-password/)

---

<div class="post-metadata">

**Author:** ![Russell74506](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@Russell74506](https://forum.core-electronics.com.au/u/Russell74506)\
**Post date:** [23 November 2018 01:55 UTC](https://forum.core-electronics.com.au/t/dont-know-root-password-for-mysql/3992/3 "2018-11-23T01:55:31Z")

</div>

Thanks arb I managed to find that myself and it worked.

---

<div class="post-metadata">

**Author:** ![Clinton](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/clinton/32/1515_2.png) [@Clinton](https://forum.core-electronics.com.au/u/Clinton)\
**Post date:** [23 November 2018 02:57 UTC](https://forum.core-electronics.com.au/t/dont-know-root-password-for-mysql/3992/4 "2018-11-23T02:57:07Z")

</div>

As a side note if you want to remove packages just use  
`sudo apt-get remove package-name`  
So for example:

```
sudo apt-get remove mysql-server
sudo apt-get remove python-mysqldb
```

---

<div class="post-metadata">

**Author:** ![Christopher99839](https://avatars.discourse-cdn.com/v4/letter/c/ee59a6/32.png) [@Christopher99839](https://forum.core-electronics.com.au/u/Christopher99839)\
**Post date:** [17 October 2019 03:46 UTC](https://forum.core-electronics.com.au/t/dont-know-root-password-for-mysql/3992/5 "2019-10-17T03:46:08Z")

</div>

Not sure if this also helps but a quick workaround is to use the login command as sudo.  
“sudo mysql -u root”

I had the same issue and that seem to help me get around it.
