当前位置:Gxlcms > 数据库问题 > Ubuntu18.04安装MySQL

Ubuntu18.04安装MySQL

时间:2021-07-01 10:21:17 帮助过:4人阅读

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   

人气教程排行