Common problems when installing MySQL on Ubuntu

When installing mysql on Ubuntu, you will encounter various problems. Here is only a list of some problems encountered after updating the system and connecting to MySQL remotely. The personal test is perfect. Share it with everyone, I hope It helps.

I encountered E: dpkg was interrupted, you must manually run'dpkg --configure -a' to correct the problem after updating the server

The method is as follows: enter the command sudo dpkg --configure -a and press Enter to run;
after the run is successful, run apt-get install zip to install the MySQL server

There is a problem when using the native Navicat to remotely connect to Ubuntu's MySQL:
There are roughly three specific error messages: 2003, 2013, and 1045.
After modifying the following configuration, you can perfectly connect to the mysql on the virtual machine.

Reason: The default connection ip address on the virtual machine is 127.0.0.1, but if you want to connect to this MySQL on this machine, you must go to the
/etc/mysql/mysql.conf.d/mysqld.cnf
directory to
bind bind
Comment out -address = 127.0.0.1 .
netstat -an|grep 3306 can view the permissions of port 3306

MySQL authorizes all users, otherwise other ips will not be able to access the MySQL
//
Grant all privileges on all accessed ips (on the MySQL server) grant all privileges on . To'root'@'%' identified by ' root ';
refresh permission to
flush privileges;

Restart the mysql server
/etc/init.d/mysql restart

After these changes are completed, you can log in to your mysql smoothly! ! !

Guess you like

Origin blog.csdn.net/xiaole060901/article/details/109102983