install MariaDB 10.2 on Ubuntu 18

Posted eagle

tags:

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

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/

 


以上是关于install MariaDB 10.2 on Ubuntu 18的主要内容,如果未能解决你的问题,请参考以下文章

Debian9 install MariaDB10.X

Installing Nginx with PHP (as PHP-FPM) and MariaDB (LEMP) on Debian 8

mariadb10.2 多实例

Mariadb数据库小结

brew uninstall older mysql and install mariadb

运维知识:CentOS7下源码编译安装MariaDB 10.2