Linux MySQL reload problem

Source: Internet
Author: User

System: ubuntu16.04 using apt-get command to install MySQL, error on startup:

Can ' t connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock '

Google a pitch, according to the online, need to modify the configuration file, the original path should be/etc/mysql/my.cnf, but there are only two lines, before it is not so ah, change do not know how to change. So try reinstalling, uninstalling MySQL:

sudo apt-get remove Mysql-server

Then delete all the MySQL folders:

Find /-name MySQL

Delete all the MySQL folders that you have searched for.

Then reinstall:

sudo Install Mysql-server

Then restart:

Service MySQL Start

Using mysql-u root login, and then the egg, still can ' t connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock '.

Then Google a pass, the period to the MySQL website to download the Deb package installation, but not successful, found to rely on a lot, the official website to download the compressed package inside the common client Server installation files, installation is always a variety of dependencies, installation is unsuccessful. Finally decided to use the Apt-get installation method, the use of Apt-get install mysql-server found as if there is no real installation, online check the following roughly means that MySQL is not uninstalled cleanly , and then use the command:

Install

Look at the log seems more reliable, but error:update-alternatives: error: alternative path /etc/mysql/my.cnf.fallback doesn‘t exist

Then continue Google, and finally find a solution:

sudo apt-get remove--purge mysql-\*sudoinstall mysql-server mysql-client

Clear MySQL and reload.

Found in this post:

Http://askubuntu.com/questions/643251/having-trouble-in-installing-and-removing-mysql-in-ubuntu

Finally, I can finally get into MySQL again. Because of the need for remote connection, you need to modify the configuration file, the front said mysql5.7.16 my.cnf inside only two lines, with the author has encountered different, as if pointing to other files:

!includedir/etc/mysql/conf.d/!includedir/etc/mysql/mysql.conf.d/

Online to find the next said is in the/etc/mysql/mysql.conf.d inside, sure enough in the path /etc/mysql/mysql.conf.d/mysqld.cnf is the real configuration file path . Then MySQL remote connection How to configure in the author another article: http://www.cnblogs.com/symen/p/5021857.html here can be seen.

Linux MySQL reload problem

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.