码迷,mamicode.com
首页 > 数据库 > 详细

Ubuntu18.04安装MySQL

时间:2019-12-22 11:00:55      阅读:71      评论:0      收藏:0      [点我收藏+]

标签:end   bind   row   远程   ubuntu   grant   ubunt   ide   roo   

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

标签:end   bind   row   远程   ubuntu   grant   ubunt   ide   roo   

原文地址:https://www.cnblogs.com/lichengbei/p/12079059.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!