Home > Database > Mysql Tutorial > body text

Ubuntu上mysql连接报错Can't connect to local MySQ_MySQL

WBOY
Release: 2016-05-31 08:48:49
Original
1072 people have browsed it

Ubuntu

最近在做ARM开发板上的Qt程序连接PC端上的mysql,出于某些需求,先给虚拟机上的ubuntu装上了mysql,详细安装方法百度上有多了。安装完毕后,在执行mysql -u root -p 时,报错:Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) ,百度了一下,发现有解决方案,按照解决方案做了(参考方法如下:http://blog.csdn.net/lmss82/article/details/4414178点击打开链接)。但是没用,因为我的mysql下的mysql.sock 文件已经丢失,当然也就找不到了。重新检索mysql.sock 丢失问题,发现有文章上写:

/usr/local/bin/mysql_install_db     //重建授权表

$/usr/local/bin/mysqld_safe &      

$/usr/local/bin/mysql

上面这种方法时可用的,问题已解决!

但是在执行mysql -u root -p 时又报错: Access denied for user 'root'@'localhost' (using password: YES)。水平不够继续百度。

给这个链接http://hi.baidu.com/ndlli/item/8a114dd4d49274846cce3f4d点击打开链接里面的方法在我电脑上起效了。Congratulations!把问题总结起来,不让它们一个个的出现,谢谢阅读!


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!