日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

CentOS7升级MariaDB 10.2版本详细步骤

發(fā)布時(shí)間:2023/12/20 编程问答 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CentOS7升级MariaDB 10.2版本详细步骤 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
#查看mariadb運(yùn)行狀態(tài): systemctl status mariadb #啟動(dòng)mariadb: systemctl start mariadb #停止mariadb :systemctl stop mariadb #重新啟動(dòng) :systemctl restart mariadb #開機(jī)啟動(dòng): systemctl enable mariadb?1、查看sql版本:# mysql --version mysql Ver 15.1 Distrib 5.5.64-MariaDB, for Linux (x86_64) using readline 5.12、查看使用狀態(tài):# systemctl status mariadb3、查看自帶安裝信息:# rpm -qa | grep -i mariadb mariadb-5.5.64-1.el7.x86_64 mariadb-server-5.5.64-1.el7.x86_64 mariadb-libs-5.5.64-1.el7.x86_64 4、查看自帶安裝信息:# yum list|grep mariadb mariadb.x86_64 1:5.5.64-1.el7 @os mariadb-libs.x86_64 1:5.5.64-1.el7 @os mariadb-server.x86_64 1:5.5.64-1.el7 @os mariadb-bench.x86_64 1:5.5.64-1.el7 os mariadb-devel.i686 1:5.5.64-1.el7 os mariadb-devel.x86_64 1:5.5.64-1.el7 os mariadb-embedded.i686 1:5.5.64-1.el7 os mariadb-embedded.x86_64 1:5.5.64-1.el7 os mariadb-embedded-devel.i686 1:5.5.64-1.el7 os mariadb-embedded-devel.x86_64 1:5.5.64-1.el7 os mariadb-libs.i686 1:5.5.64-1.el7 os mariadb-test.x86_64 1:5.5.64-1.el7 os5、停止服務(wù)運(yùn)行并查看:# systemctl stop mariadb && systemctl status mariadb 6、開始卸載# yum remove -y mariadb && yum remove -y mariadb-* 7、#已搜不到安裝信息 # yum list installed |grep mariadb # rpm -qa|grep mariadb # find / -name mysql /var/lib/mysql /usr/lib64/mysql # rm -rf /var/lib/mysql/ # rm -rf /var/lib64/mysql/ # find / -name mariadb /var/log/mariadb # rm -rf /var/log/mariadb 8、配置yum源為國內(nèi)地址:# vim /etc/yum.repos.d/Mariadb.repo 錄入以下內(nèi)容 [mariadb] name = MariaDB baseurl = https://mirrors.ustc.edu.cn/mariadb/yum/10.2/centos7-amd64 gpgkey=https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB gpgcheck=1 9、清除yum源緩存數(shù)據(jù),并生成新的yum源數(shù)據(jù)緩存 # yum clean all && yum makecache all 10、查看下載緩存信息 # ll /var/cache/yum/x86_64/7/mariadb 12、開始安裝 # yum install MariaDB-server MariaDB-client -y .... 已安裝:MariaDB-client.x86_64 0:10.2.31-1.el7.centos MariaDB-server.x86_64 0:10.2.31-1.el7.centos作為依賴被安裝:MariaDB-common.x86_64 0:10.2.31-1.el7.centos MariaDB-compat.x86_64 0:10.2.31-1.el7.centos boost-program-options.x86_64 0:1.53.0-27.el7galera.x86_64 0:25.3.28-1.rhel7.el7.centos完畢! 13、啟動(dòng)mariadb # systemctl start mariadb.service 14、初始化配置信息(設(shè)置root密碼) # /usr/bin/mysql_secure_installationNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDBSERVERS 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:你的密碼 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] y- Dropping test database...... Success!- Removing privileges on test database...... Success!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.Thanks for using MariaDB! 安裝完成 15、創(chuàng)建初始化數(shù)據(jù)庫(創(chuàng)建數(shù)據(jù)庫如下圖) # mysql -uroot -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 20 Server version: 10.2.31-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)]> mysql> use mysql; mysql> CREATE USER 'glpi'@'%' IDENTIFIED BY 'glpi'; #用戶名 密碼 mysql> GRANT USAGE ON *.* TO 'glpi'@'%' IDENTIFIED BY 'glpi'; mysql> create database glpi; mysql>grant select,insert,update,delete,create,drop on glpi.* to 'glpi'@'%'; mysql> quit

16、#重新啟動(dòng) :systemctl restart mariadb
17、#開機(jī)啟動(dòng): systemctl enable mariadb?

總結(jié)

以上是生活随笔為你收集整理的CentOS7升级MariaDB 10.2版本详细步骤的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。