---
title: "Ubuntu Server Install MySQL"
author: "androider"
date: "2010-05-01T16:09:48Z"
tags: []
categories: ["操作系统"]
slug: "ubuntu-server-install-mysql"
draft: false
lastmod: "2010-05-01T16:09:48Z"
id: 657549
url: "https://androider.iteye.com/blog/657549"
---

## sudo apt-get install mysql-server libmysqlclient15-dev mysql-client

但是无论如何连接都是:

ERROR 1045 (28000): Access denied for user ….@localhost (using password: NO)

后来发现：/etc/mysql/debian.cnf里面居然是明文的密码

成功登录

grant all privileges on \*.* to root@localhost;

flush privileges;

修改root密码

update mysql.user set password=password（”newpassword”）where user=”root”;

flush privileges;

用root新密码登录即可