Mysql connection error on Ubuntu Canamp; amp; #39; tconnecttolocalMySQLserverthroughsocketamp; amp; #39; varrun Ubuntu
Recently, I am working on the ARM development board to connect the Qt program to mysql on the PC end. for some requirements, I first installed mysql on ubuntu on the virtual machine. more installation methods are available on Baidu. When mysql-u root-p is executed, the following error occurs: Can't connect to local MySQL server through socket '/var/run/mysqld. sock '(2). after Baidu finds a solution, follow the solution (see http://blog.csdn.net/lmss82/article/details/4414178click to open the link ). But it is useless, because the mysql. sock file under my mysql has been lost, and of course it cannot be found. Re-retrieve the mysql. sock loss issue and find the following articles:
/Usr/local/bin/mysql_install_db // re-create the authorization table
$/Usr/local/bin/mysqld_safe &
$/Usr/local/bin/mysql
The above method is available. The problem has been solved!
However, when mysql-u root-p is executed, the following error occurs: Access denied for user 'root' @ 'localhost' (using password: YES ). The level is not enough to continue Baidu.
Give this linkHttp://hi.baidu.com/ndlli/item/8a114dd4d49274846cce3f4dClick Open link,The method works on my computer. Congratulations! Summarize the problems and prevent them from appearing one by one. thank you for reading!