Ubuntu18.04安装MySQL

Posted lichengbei

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu18.04安装MySQL相关的知识,希望对你有一定的参考价值。

lichengbei

2019-12-21

安装server

root@ubuntu1804:~# apt install mysql-server

 

安装client

root@ubuntu1804:~# apt install mysql-client

 

设置root密码并配置远程权限

root@ubuntu1804:~# mysql -u root -p

Enter password:{enter}

Welcome to the MySQL monitor.  Commands end with ; or g.

mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘1234.qwer‘ WITH GRANT OPTION;

Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> FLUSH PRIVILEGES;

Query OK, 0 rows affected (0.00 sec)

mysql> COMMIT;

Query OK, 0 rows affected (0.00 sec)

mysql> QUIT

Bye

 

修改配置文件使可远程登录并重启mysql服务

root@ubuntu1804:~# vim /etc/mysql/mysql.conf.d/mysqld.cnf

bind-address            = 0.0.0.0

root@ubuntu1804:~# service mysql restart

 

Navicat登录验证

技术图片

以上是关于Ubuntu18.04安装MySQL的主要内容,如果未能解决你的问题,请参考以下文章

Ubuntu18.04安装教程

Ubuntu 18.04上安装 phpMyAdmin

Ubuntu18.04安装CUDA

Ubuntu18.04 安装OpenCV

Ubuntu 18.04下OpenFOAM 2.3.1安装及配置

ubuntu18.04安装教程