ubuntu安装mysql数据库并使用Navicat连接

162 阅读1分钟

mysql安装

sudo apt update 
sudo apt install -y  mysql-server

免密进入

sudo mysql -uroot

然后使用sql更新用户密码:

alter user 'root'@'localhost' identified with mysql_native_password by '你的密码';

exit

然后就可以使用密码登陆mysql 的root账户了

mysql -u root -p

navicat授权远程使用

查看一下userupdate user set host='%'  where user = 'root';
flush privileges;
grant all on *.* to 'root'@'%';
flush privileges;

然后修改

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

bind-address            = 0.0.0.0
mysqlx-bind-address     = 0.0.0.0


service mysql restat