Ubuntu mysql installation, remote, configuration

1. Installation

apt install mysql-server
apt install mysql-client

After installation, the configuration file will be /etc/mysqlinside,

2 Remote configuration

First configure the password. You can refer to here to install mysql under Ubuntu 18.04. If there is no initial password, reset the root password.
You can also directly enter Mysql and then change the password for root.

sudo mysql -u root

Then start configuring the remote
MySQL table:

GRANT ALL PRIVILEGES ON *.* TO '用户名'@'%' IDENTIFIED BY '密码' WITH GRANT 
update user set authentication_string =password('root'),plugin='msyql_native_password' where user='root';OPTION;
FLUSH PRIVILEGES;

Also change the IP restrictions of the configuration file

sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf

Comment out blind-addressthe part
and finally restart the mysql service
service mysql restart

3. Possible firewall issues

ubuntu firewall UFW

1698 Access denied for user root@localhost error solution

See the solution here

4. Other errors

ERROR 1524 (HY000): Plugin 'msyql_native_password' is not loaded (Ubuntu)
https://blog.csdn.net/nageaixiaodenanhai/article/details/89319444
Add in /etc/mysql/my.cnf

[mysqld]
skip-grant-tables

Guess you like

Origin blog.csdn.net/Defiler_Lee/article/details/120921683