Centos 6 instala Mariadb

versión:

centos 6.8

Mariadb 5.5.61

1. Cree un archivo MariaDB.repo en el directorio /etc/yum.repos.d/ con el siguiente contenido:

# MariaDB 5.5 CentOS repository list - created 2014-03-04 11:20 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Esta tarjeta de fuente oficial también, reemplazada por una fuente nacional:

baseurl = https://mirrors.ustc.edu.cn/mariadb/yum/5.5/centos6-amd64
gpgkey=https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB

2.Haga efectivo el archivo fuente:

yum repolist all

3. Inicie la instalación:

yum install MariaDB-server MariaDB-client

4. Iniciar sesión

Utilice service mariadb start en centos7, pero no en cenos6, pero también pruebe systemctl start mariadb. Se utilizan los siguientes métodos:

[root@IChen /]# service mysql start
Starting MariaDB.180828 11:28:31 mysqld_safe Logging to '/var/lib/mysql/webserver.err'.
180828 11:28:31 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
. SUCCESS!
[root@IChen /]# mysql -uroot
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.61-MariaDB MariaDB Server
 
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]>

Finalmente instalado.

5. Modifique la contraseña de root:

[root@IChen /]# mysqladmin -u root password '123456'
[root@IChen /]# mysqladmin -uroot -p123456 password '123'

6. Permitir que los usuarios raíz se conecten de forma remota

MariaDB [(none)]> use mysql
 
MariaDB [mysql]> grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [mysql]> select host,user,password from user;
+-----------+------+-------------------------------------------+
| host      | user | password                                  |
+-----------+------+-------------------------------------------+
| localhost | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |
| webserver | root |                                           |
| 127.0.0.1 | root |                                           |
| ::1       | root |                                           |
| localhost |      |                                           |
| webserver |      |                                           |
| %         | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |
+-----------+------+-------------------------------------------+
7 rows in set (0.00 sec)
 
MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

Conección remota

mysql -h 127.0.0.1 -P 3306 -u root -p 123456

7. Importar archivos

use abc;
set names utf8;
source /home/abc/abc.sql;
[root@IChen /]# mysql -uroot -p123456 abc < test.sql

Supongo que te gusta

Origin blog.csdn.net/ichen820/article/details/115070955
Recomendado
Clasificación