欢迎投稿

今日深度:

centos 7.6 安装mariadb,干脆卸载安装自己安装

centos 7.6 安装mariadb,干脆卸载安装自己安装


腾讯轻量版服务器 查看系统版本号

cat /etc/centos-release

CentOS Linux release 7.6.1810 (Core)  

yum install mysql 发现安装的时mariadb  而且不知道密码是啥。

干脆卸载安装自己安装mariadb

 yum install mariadb-server mariadb -y

速度极快,很快进入设置界面,

启动查看状态

systemctl start mariadb
systemctl status mariadb

初始化

mysql_secure_installation 

      

(base) [root@VM-16-15-centos ~]# systemctl start mariadb

(base) [root@VM-16-15-centos ~]# systemctl status mariadb

● mariadb.service - MariaDB database server

   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)

   Active: active (running) since Mon 2022-09-12 07:07:02 CST; 9s ago

  Process: 31209 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)

  Process: 31124 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)

 Main PID: 31207 (mysqld_safe)

    Tasks: 20

   Memory: 101.5M

   CGroup: /system.slice/mariadb.service

           ├─31207 /bin/sh /usr/bin/mysqld_safe --basedir=/usr

           └─31373 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin -...

Sep 12 07:07:00 VM-16-15-centos mariadb-prepare-db-dir[31124]: MySQL manual for more instructions.

Sep 12 07:07:00 VM-16-15-centos mariadb-prepare-db-dir[31124]: Please report any problems at http://mariadb.org/jira

Sep 12 07:07:00 VM-16-15-centos mariadb-prepare-db-dir[31124]: The latest information about MariaDB is available a...g/.

Sep 12 07:07:00 VM-16-15-centos mariadb-prepare-db-dir[31124]: You can find additional information about the MySQL...at:

Sep 12 07:07:00 VM-16-15-centos mariadb-prepare-db-dir[31124]: http://dev.mysql.com

Sep 12 07:07:00 VM-16-15-centos mariadb-prepare-db-dir[31124]: Consider joining MariaDB's strong and vibrant community:

Sep 12 07:07:00 VM-16-15-centos mariadb-prepare-db-dir[31124]: https://mariadb.org/get-involved/

Sep 12 07:07:00 VM-16-15-centos mysqld_safe[31207]: 220912 07:07:00 mysqld_safe Logging to '/var/log/mariadb/mari...og'.

Sep 12 07:07:00 VM-16-15-centos mysqld_safe[31207]: 220912 07:07:00 mysqld_safe Starting mysqld daemon with datab...ysql

Sep 12 07:07:02 VM-16-15-centos systemd[1]: Started MariaDB database server.

Hint: Some lines were ellipsized, use -l to show in full.

(base) [root@VM-16-15-centos ~]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB

      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current

password for the root user.  If you've just installed MariaDB, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.

Enter current password for root (enter for none):

OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB

root user without the proper authorisation.

Set root password? [Y/n] y

New password:

Re-enter new password:

Sorry, passwords do not match.

New password:

Re-enter new password:

Password updated successfully!

Reloading privilege tables..

 ... Success!


 

By default, a MariaDB installation has an anonymous user, allowing anyone

to log into MariaDB without having to have a user account created for

them.  This is intended only for testing, and to make the installation

go a bit smoother.  You should remove them before moving into a

production environment.

Remove anonymous users? [Y/n] y

 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n

 ... skipping.

By default, MariaDB comes with a database named 'test' that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n] n

 ... skipping.

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n] y

 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB

installation should now be secure.

命令和mysql一模一样。


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

MariaDB [(none)]> create database master_pro;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]>

mysql -uroot -p密码

mysql show databases;

mysql create database  master_pro;

这点比mysql好,提示当前数据库

 MariaDB [(none)]>   use master_pro;
Database changed
MariaDB [master_pro]>

问题来了,mariadb 暂时不支持  JSONFields

用django  vue admin 的伙伴们谨慎选择。


ERRORS:
system.SystemConfig: (fields.E180) MariaDB does not support JSONFields.
system.SystemConfig: (fields.E180) MariaDB does not support JSONFields.
system.SystemConfig: (fields.E180) MariaDB does not support JSONFields.
system.SystemConfig: (fields.E180) MariaDB does not support JSONFields.

WARNINGS:
?: (mysql.W002) MariaDB Strict Mode is not set for database connection 'default'
        HINT: MariaDB's Strict Mode fixes many data integrity problems in MariaDB, such as data truncation upon insertion, by escalating warnings into errors. It is strongly recommended you activate it. See: https://docs.djangoproject.com/en/3.2/ref/databases/#mysql-sql-mode
(django) [root@VM-16-15-centos backend]#

 

www.htsjk.Com true http://www.htsjk.com/mariadb/45948.html NewsArticle centos 7.6 安装mariadb,干脆卸载安装自己安装 腾讯轻量版服务器 查看系统版本号 cat /etc/centos-release CentOS Linux release 7.6.1810 (Core)   yum install mysql 发现安装的时mariadb  而且不知道密码是啥...
评论暂时关闭