1.安裝服務mysql
apt-get install mariadb-server
2.啓用啓動服務sql
sudo systemctl start mariadb sudo systemctl enable mariad
3.後續設置命令數據庫
mysql_secure_installation
4.登入數據庫後,設置全部用戶使用root鏈接,並更新設置。less
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '000000' WITH GRANT OPTION; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> flush privileges;
5.使用navicate遠程鏈接時出現"10061error「spa
解決方法:code
(1) 修改/etc/mysql/my.cnf文件。打開文件,找到下面內容:
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
# 把上面這一行註釋掉或者把127.0.0.1換成合適的IP,建議註釋掉。 server
(2)但如今最新版的mariaDB 已將配置文件拆分此時my.cnf文件裏面顯示以下
!includedir /etc/mysqql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/
# 這兩句話的意思是配置文件包含了上面兩個文件夾全部的文件,那麼如今一一查找bind-address = 127.0.0.1這句話寫在哪了。
以後在/etc/mysql/mariadb.conf.d/50-server.cnf此文件下找到bind-address = 127.0.0.1這句話,註釋掉就好了。blog