Here are the commands to run to install MariaDB 10.2 from the MariaDB repository on your Ubuntu system:
sudo apt-get install software-properties-common sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 sudo add-apt-repository ‘deb [arch=amd64,arm64,ppc64el] http://mirrors.neusoft.edu.cn/mariadb/repo/10.2/ubuntu bionic main‘
Once the key is imported and the repository added you can install MariaDB 10.2 from the MariaDB repository with:
sudo apt update sudo apt install mariadb-server
Some times we need to stop or start MariaDB service. Use the following commands to stop, start, check status and restart MariaDB servic.
$ sudo systemctl stop mysql.service # To Stop MariaDB service $ sudo systemctl start mysql.service # To Start MariaDB service $ sudo systemctl status mysql.service # To Check MariaDB service status $ sudo systemctl restart mysql.service # To Stop then Start MariaDB service
try remotely connect to the server
it‘s very trick,
firstly you have to comments bind-address in file /etc/mysql/my.cnf in case you are encountering 10061 error refer to this page
#bind-address = <some ip-address>
and then reset root user of mariadb‘s password refer to this
+-----------+------+-------------------------------------------+ | host | user | password | +-----------+------+-------------------------------------------+ | localhost | root | *C61A1C944BC7AXXXXXXXXXXXXXX4B81A462D9CB3 | | 127.0.0.1 | root | *C61A1C944BC7A3XXXXXXXXXXXXX4B81A462D9CB3 | | ::1 | root | *C61A1C944BC7A3XXXXXXXXXXXXX4B81A462D9CB3 | | % | root | *81F5E21E35407DXXXXXXXXXXXXXEBFB6AF209E1B | wrong password made me facing 1045 error +-----------+------+-------------------------------------------+
restar the db service
service mysql restart
then connect to the db via Navicat or mariadb CLI command
mysql -h xxx.xx.xx -u root -p
reference documents
https://askubuntu.com/questions/1009175/mariadb-10-0-33-configuring-mariadb-for-remote-client-access
https://www.jb51.net/article/26505.htm
https://mariadb.com/kb/en/library/configuring-mariadb-for-remote-client-access/
https://downloads.mariadb.org/mariadb/repositories/#mirror=neusoft&distro=Ubuntu&distro_release=bionic--ubuntu_bionic&version=10.2
https://tecadmin.net/install-mariadb-10-on-ubuntu/
原文地址:https://www.cnblogs.com/guoapeng/p/9823844.html