数据库 MARIADB—mysql
数据库: 高效的存储和处理数据的介质(磁盘和内存)
分类:关系型数据库(SQL)和非关系型数据库(NOSQL:Not Only SQL)
1.安装重启
[root@localhost ~]# yum install mariadb-server -y
[root@localhost ~]# systemctl restart mariadb.service
2.初始化数据库
[root@localhost ~]# mysql_secure_installation
3.进入MySQL数据库
直接进入:
[root@localhost ~]# mysql -u root -p mysql
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 30
Server version: 10.3.11-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 [mysql]>
[root@localhost ~]# mysql -u root -p mysql
只进入mariadb:
[root@localhost ~]# mysql -uroot -pWXY
Welcome to the MariaDB monitor. Commands end with ;
or \g.Your MariaDB connection id is 29Server
version: 10.3.11-MariaDB MariaDB ServerCopyright (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)]>
4.列出表信息
[root@localhost ~]# mysql -u root -p mysql -e "show tables";
5.创建数据库
:create database person
[root@localhost ~]# mysql -uroot -pWXY
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 25
Server version: 10.3.11-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracl