uwp連接mysql數據庫_在 UWP 應用中使用 SQLite 數據庫

在 UWP 應用中使用 SQLite 數據庫Use a SQLite database in a UWP app

06/26/2020

本文內容

可以使用 SQLite 在用戶設備上的輕量級數據庫中存儲和檢索數據。You can use SQLite to store and retrieve data in a light-weight database on the user's device. 本指南演示如何執行該操作。This guide shows you how.

使用 SQLite 進行本地存儲一些好處Some benefits of using SQLite for local storage

??SQLite 具有輕量和獨立的特點。SQLite is light-weight and self-contained. 它是沒有其他任何依賴項的代碼庫。It's a code library without any other dependencies. 無需進行任何配置。There's nothing to configure.

??沒有數據庫服務器。There's no database server. 客戶端和服務器在同一進程中運行。The client and the server run in the same process.

??SQLite 位于公共域中,因此你可以自由地使用它并將它與應用一起分配。SQLite is in the public domain so you can freely use and distribute it with your app.

??SQLite 可跨平臺和體系結構工作。SQLite works across platforms and architectures.

可在此處了解有關 SQLite 的詳細信息。You can read more about SQLite here.

選擇抽象層Choose an abstraction layer

我們建議使用由 Microsoft 構建的 Entity Framework Core 或開源 SQLite 庫。We recommend that you use either the Entity Framework Core or the open-source SQLite library built by Microsoft.

Entity Framework CoreEntity Framework Core

Entity Framework (EF) 是一個對象關系映射程序,可用于使用特定于域的對象處理關系數據。Entity Framework (EF) is an object-relational mapper that you can use to work with relational data by using domain-specific objects. 如果已使用此框架處理其他 .NET 應用中的數據,則可以將該代碼遷移到 UWP 應用,它將處理對連接字符串的相應更改。If you've already used this framework to work with data in other .NET apps, you can migrate that code to a UWP app and it will work with appropriate changes to the connection string.

SQLite 庫SQLite library

The Microsoft.Data.Sqlite library implements the interfaces in the System.Data.Common namespace. Microsoft 將主動保留這些實現,它們提供了圍繞低級別本機 SQLite API 的直觀的包裝器。Microsoft actively maintains these implementations, and they provide an intuitive wrapper around the low-level native SQLite API.

本指南的其余部分將幫助你使用此庫。The rest of this guide helps you to use this library.

將解決方案設置為使用 Microsoft.Data.SQlite 庫Set up your solution to use the Microsoft.Data.SQlite library

我們將從基本 UWP 項目入手,添加類庫,然后安裝合適的 Nuget 包。We'll start with a basic UWP project, add a class library, and then install the appropriate Nuget packages.

添加到解決方案的類庫的類型以及安裝的特定程序包取決于應用面向的最低版本的 Windows SDK。The type of class library that you add to your solution, and the specific packages that you install depends on the minimum version of the Windows SDK that your app targets. 可以在 UWP 項目的屬性頁中找到該信息。You can find that information in the properties page of your UWP project.

aa11b4b03c585edb2fcdb81e83eb196f.png

根據 UWP 項目面向的最低版本的 Windows SDK,使用以下章節之一。Use one of the following sections depending on the minimum version of the Windows SDK that your UWP project targets.

項目的最低版本沒有將 Fall Creators Update 作為目標The minimum version of your project does not target the Fall Creators Update

如果使用的是 Visual Studio 2015,請單擊“幫助”->“關于 Microsoft Visual Studio”。If you're using Visual Studio 2015, click Help->About Microsoft Visual Studio. 然后,在已安裝程序的列表中,確保你具有 NuGet 包管理器版本 3.5 或更高版本。Then in the list of installed programs, make sure that you have NuGet package manager version of 3.5 or higher. 如果版本號較低,請安裝此處提供的更高版本的 NuGet。If your version number is lower than that, install a later version of NuGet here. 在該頁面上,你將發現所有版本的 Nuget 都在 Visual Studio 2015 標題下方列出。On that page, you'll find all of the versions of Nuget listed beneath the Visual Studio 2015 heading.

接下來,將類庫添加到解決方案。Next, add class library to your solution. 你不必使用類庫來包含你的數據訪問代碼,但我們會使用一個我們的示例。You don't have to use a class library to contain your data access code, but we'll use one our example. 我們將庫命名為 DataAccessLibrary,并將庫中的類命名為 DataAccess。We'll name the library DataAccessLibrary and we'll name the class in the library to DataAccess.

c6cb361ce1e7cf28cb82eece289e78aa.png

右鍵單擊該解決方法,然后單擊“管理解決方案的 NuGet 包”。Right-click the solution, and then click Manage NuGet Packages for Solution.

aac30db9a811ec7ba1ef3b76361f5b82.png

如果使用的是 Visual Studio 2015,請選擇“已安裝”選項卡,并確保 Microsoft.NETCore.UniversalWindowsPlatform 程序包的版本號為 5.2.2 或更高。If you're using Visual Studio 2015, Choose the Installed tab, and make sure that the version number of the Microsoft.NETCore.UniversalWindowsPlatform package is 5.2.2 or higher.

e99df59c688c317a9b14766935ab3e3b.png

如果不是,請將包更新到更新的版本。If it isn't, update the package to a newer version.

選擇“瀏覽”選項卡,然后搜索“Microsoft.Data.SQLite”程序包。Choose the Browse tab, and search for the Microsoft.Data.SQLite package. 安裝該程序包的版本 1.1.1(或更低)。Install version 1.1.1 (or lower) of that package.

82306b366d65aac03b935c1c4c42066a.png

你最低版本的項目已鎖定 Fall Creators UpdateThe minimum version of your project targets the Fall Creators Update

將 UWP 項目的最低版本升級到 Fall Creators Update 有幾個好處。There's a couple of benefits to raising the minimum version of your UWP project to the Fall Creators update.

首先,你可以使用 .NET Standard 2.0 庫而不是常規的類庫。First off, you can use .NET Standard 2.0 libraries instead of regular class libraries. 這意味著你可以將數據訪問代碼與任何其他基于 .NET 的應用(如 WPF、Windows 窗體、Android、iOS 或 ASP.NET 應用)共享。That means that you can share your data access code with any other .NET-based app such as a WPF, Windows Forms, Android, iOS, or ASP.NET app.

其次,應用不需將 SQLite 庫打包。Secondly, your app does not have to package SQLite libraries. 相反,應用可以使用隨 Windows 一起安裝的 SQLite 版本。Instead, your app can use the version of SQLite that comes installed with Windows. 這將帶來幾個方面的好處。This helps you in a few ways.

??減小了應用程序的大小,因為你不必下載 SQLite 二進制文件然后將其打包為應用程序的一部分。Reduces the size of your application because you don't have to download the SQLite binary, and then package it as part of your application.

??如果 SQLite 發布了針對 SQLite 中的 bug 和安全漏洞的重要修復程序,你就不必向用戶推送你的應用的新版本。Prevents you from having to push a new version of your app to users in the event that SQLite publishes critical fixes to bugs and security vulnerabilities in SQLite. Windows 版本的 SQLite 由 Microsoft 與 SQLite.org 協作維護。The Windows version of SQLite is maintained by Microsoft in coordination with SQLite.org.

??應用加載時間可能更短,因為 SDK 版本的 SQLite 很有可能已被加載到內存中。App load time has the potential to be faster because most likely, the SDK version of SQLite will already be loaded into memory.

讓我們開始向你的解決方案添加 .NET Standard 2.0 類庫。Lets start by adding a .NET Standard 2.0 class library to your solution. 你不必使用類庫來包含你的數據訪問代碼,但我們會使用一個我們的示例。It's not necessary that you use a class library to contain your data access code, but we'll use one our example. 我們將庫命名為 DataAccessLibrary,并將庫中的類命名為 DataAccess。We'll name the library DataAccessLibrary and we'll name the class in the library to DataAccess.

34eec2ea0e16892f66596fbb272fa8d4.png

右鍵單擊該解決方法,然后單擊“管理解決方案的 NuGet 包”。Right-click the solution, and then click Manage NuGet Packages for Solution.

4a13f38b316d5632fe669cb6eae60ca4.png

備注

如果希望 .NET Standard 類庫能夠訪問 UWP 應用的應用文件夾和圖像資產,則需要將其標記為其屬性中的 EmbeddedResource 和 CopyAlways 。If you want your .NET Standard class library to be able to access app folders and image assets of your UWP app, you will need to mark it as EmbeddedResource and CopyAlways in its properties.

此時,你已經有一個選擇。At this point, you have a choice. 你可以使用 Windows 附帶的 SQLite 版本,如果你出于某種原因要使用特定版本的 SQLite,則可以在程序中包含 SQLite 庫。You can use the version of SQLite that is included with Windows or if you have some reason to use a specific version of SQLite, you can include the SQLite library in your package.

讓我們開始演示如何使用 Windows 附帶的 SQLite 版本。Let's start with how you use the version of SQLite that included with Windows.

使用隨 Windows 一起安裝的 SQLite 版本To use the version of SQLite that is installed with Windows

選擇“瀏覽”選項卡,搜索“Microsoft.Data.SQLite.core”程序包,然后安裝它。Choose the Browse tab, and search for the Microsoft.Data.SQLite.core package, and then install it.

0e8d297a9ccaa24cff4ae809494fd59a.png

搜索“SQLitePCLRaw.bundle_winsqlite3”程序包,然后僅將它安裝到應用程序中的 UWP 項目。Search for the SQLitePCLRaw.bundle_winsqlite3 package, and then install it only to the UWP project in your solution.

255667db5f3e9a1a13f744bb6473dc52.png

將 SQLite 包含在你的應用中To include SQLite with your app

你不必執行此操作。You don't have to do this. 但如果你出于某種原因要將特定版本的 SQLite 包含在你的應用中,請選擇“瀏覽”選項卡,然后搜索“Microsoft.Data.SQLite”程序包。But if you have a reason to include a specific version of SQLite with your app, choose the Browse tab, and search for the Microsoft.Data.SQLite package. 安裝該程序包的版本 2.0(或更低)。Install version 2.0 (or lower) of that package.

0289d3116b18669f6219543409a8a2ab.png

在 SQLite 數據庫中添加和檢索數據Add and retrieve data in a SQLite database

我們將執行以下操作:We'll do these things:

1??準備數據訪問類。Prepare the data access class.

2??初始化 SQLite 數據庫。Initialize the SQLite database.

3??將數據插入到 SQLite 數據庫。Insert data into the SQLite database.

4??從 SQLite 數據庫檢索數據。Retrieve data from the SQLite database.

5??添加基本用戶界面。Add a basic user interface.

準備數據訪問類Prepare the data access class

從 UWP 項目中,添加對解決方案中的 DataAccessLibrary 項目的引用。From your UWP project, add a reference to the DataAccessLibrary project in your solution.

1218cc74ec53b5d314661e26c110a06c.png

在 UWP 項目中,將以下 using 語句添加到 App.xaml.cs 和 MainPage.xaml.cs 文件。Add the following using statement to the App.xaml.cs and MainPage.xaml.cs files in your UWP project.

using DataAccessLibrary;

在 DataAccessLibrary 解決方案中打開 DataAccess 類并將其設為靜態。Open the DataAccess class in your DataAccessLibrary solution and make that class static.

備注

盡管我們的示例將數據訪問代碼放在靜態類中,但這只是一個設計選擇,并且是全憑自愿。While our example will place data access code in a static class, it's just a design choice and is completely optional.

namespace DataAccessLibrary

{

public static class DataAccess

{

}

}

將以下 using 語句添加到此文件頂部。Add the following using statements to the top of this file.

using Microsoft.Data.Sqlite;

using System.Collections.Generic;

初始化 SQLite 數據庫Initialize the SQLite database

向 DataAccess 類添加一個初始化 SQLite 數據庫的方法。Add a method to the DataAccess class that initializes the SQLite database.

public async static void InitializeDatabase()

{

await ApplicationData.Current.LocalFolder.CreateFileAsync("sqliteSample.db", CreationCollisionOption.OpenIfExists);

string dbpath = Path.Combine(ApplicationData.Current.LocalFolder.Path, "sqliteSample.db");

using (SqliteConnection db =

new SqliteConnection($"Filename={dbpath}"))

{

db.Open();

String tableCommand = "CREATE TABLE IF NOT " +

"EXISTS MyTable (Primary_Key INTEGER PRIMARY KEY, " +

"Text_Entry NVARCHAR(2048) NULL)";

SqliteCommand createTable = new SqliteCommand(tableCommand, db);

createTable.ExecuteReader();

}

}

此代碼將創建 SQLite 數據庫并將其存儲在應用程序的本地數據存儲區中。This code creates the SQLite database and stores it in the application's local data store.

在此示例中,我們將數據庫命名為 sqlliteSample.db,但你可以使用任何想要的名稱,只要你在你實例化的所有 SqliteConnection 對象中使用該名稱。In this example, we name the database sqlliteSample.db but you can use whatever name you want as long as you use that name in all SqliteConnection objects that you instantiate.

在 UWP 項目的 App.xaml.cs 文件的構造函數中,調用 DataAccess 類的 InitializeDatabase 方法。In the constructor of the App.xaml.cs file of your UWP project, call the InitializeDatabase method of the DataAccess class.

public App()

{

this.InitializeComponent();

this.Suspending += OnSuspending;

DataAccess.InitializeDatabase();

}

將數據插入到 SQLite 數據庫Insert data into the SQLite database

向 DataAccess 類添加一個將數據插入到 SQLite 數據庫的方法。Add a method to the DataAccess class that inserts data into the SQLite database. 此代碼在查詢中使用參數以阻止 SQL 注入攻擊。This code uses parameters in the query to prevent SQL injection attacks.

public static void AddData(string inputText)

{

string dbpath = Path.Combine(ApplicationData.Current.LocalFolder.Path, "sqliteSample.db");

using (SqliteConnection db =

new SqliteConnection($"Filename={dbpath}"))

{

db.Open();

SqliteCommand insertCommand = new SqliteCommand();

insertCommand.Connection = db;

// Use parameterized query to prevent SQL injection attacks

insertCommand.CommandText = "INSERT INTO MyTable VALUES (NULL, @Entry);";

insertCommand.Parameters.AddWithValue("@Entry", inputText);

insertCommand.ExecuteReader();

db.Close();

}

}

從 SQLite 數據庫檢索數據Retrieve data from the SQLite database

添加從 SQLite 數據庫獲取數據行的方法。Add a method that gets rows of data from a SQLite database.

public static List GetData()

{

List entries = new List();

string dbpath = Path.Combine(ApplicationData.Current.LocalFolder.Path, "sqliteSample.db");

using (SqliteConnection db =

new SqliteConnection($"Filename={dbpath}"))

{

db.Open();

SqliteCommand selectCommand = new SqliteCommand

("SELECT Text_Entry from MyTable", db);

SqliteDataReader query = selectCommand.ExecuteReader();

while (query.Read())

{

entries.Add(query.GetString(0));

}

db.Close();

}

return entries;

}

Read 方法將向前瀏覽返回的數據的行。The Read method advances through the rows of returned data. 如果有剩下的行,它將返回 true,否則返回 false。It returns true if there are rows left, otherwise it returns false.

GetString 方法返回字符串形式的指定列的值。The GetString method returns the value of the specified column as a string. 它將接受一個整數值,該值表示所需的數據的從零開始的列序號。It accepts an integer value that represents the zero-based column ordinal of the data that you want. You can use similar methods such as GetDataTime and GetBoolean. 請根據列包含的數據的類型選擇方法。Choose a method based on what type of data the column contains.

在此例子中,序號參數并不重要,因為我們選擇了單個列中的所有條目。The ordinal parameter isn't as important in this example because we are selecting all of the entries in a single column. 但是,如果多個列是你的查詢的一部分,請使用序號值獲取你要從中拉取數據的列。However, if multiple columns are part of your query, use the ordinal value to obtain the column you want to pull data from.

添加基本用戶界面Add a basic user interface

在 UWP 項目的 MainPage.xaml 文件中,添加以下 XAML。In the MainPage.xaml file of the UWP project, add the following XAML.

Add

此基本用戶界面為用戶提供了 TextBox,可用于鍵入我們將添加到 SQLite 數據庫的字符串。This basic user interface gives the user a TextBox that they can use to type a string that we'll add to the SQLite database. 我們要將此 UI 中的 Button 連接到事件處理程序,后者將從 SQLite 數據庫檢索數據然后在 ListView 中顯示數據。We'll connect the Button in this UI to an event handler that will retrieve data from the SQLite database and then show that data in the ListView.

在 MainPage.xaml.cs 文件中,添加以下處理程序。In the MainPage.xaml.cs file, add the following handler. 這是我們關聯到 UI 中的 Button 的 Click事件的方法。This is the method that we associated with the Click event of the Button in the UI.

private void AddData(object sender, RoutedEventArgs e)

{

DataAccess.AddData(Input_Box.Text);

Output.ItemsSource = DataAccess.GetData();

}

完成了。That's it. 探索 Microsoft.Data.Sqlite 以了解 SQLite 數據庫的其他功能。Explore the Microsoft.Data.Sqlite to see what other things you can do with your SQLite database. 查看下面的鏈接,了解在 UWP 應用中使用數據的其他方法。Check out the links below to learn about other ways to use data in your UWP app.

后續步驟Next steps

將應用直接連接到 SQL Server 數據庫Connect your app directly to a SQL Server database

在跨不同平臺的不同應用之間共享代碼Share code between different apps across different platforms

使用 Azure SQL 后端添加大綱/細節頁面Add master detail pages with Azure SQL back ends

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/397073.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/397073.shtml
英文地址,請注明出處:http://en.pswp.cn/news/397073.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

12-事件委托(事件代理)

什么是事件委托 通俗的講,事件就是onclick,onmouseover,onmouseout,等就是事件,委托呢,就是讓別人來做,這個事件本來是加在某些元素上的,然而你卻加到別人身上來做,完成這…

oracle 窗口函數 (keep)

看到很多人對于keep不理解,這里解釋一下!Returns the row ranked first using DENSE_RANK2種取值:DENSE_RANK FIRSTDENSE_RANK LAST在keep (DENSE_RANK first ORDER BY sl) 結果集中再取max、min的例子。SQL> select * from test;ID MC SL…

MySQL 的實時性能監控利器

操作系統及MySQL數據庫的實時性能狀態數據尤為重要,特別是在有性能抖動的時候,這些實時的性能數據可以快速幫助你定位系統或MySQL數據庫的性能瓶頸,就像你在Linux系統上使用「top,sar,iostat」等命令工具一樣&#xff…

設置linearlayout最大高度_技術案例 | 排煙口個數與擋煙垂壁高度的關系探討

隨著《建筑防煙排煙系統技術標準》( 以下簡稱新規范) 的正式實施,新規范對排煙系統的設計提出了完全不同的設計理念。根據新規范正文: 當建筑空間凈高不大于6m時,每個防煙分區的排煙量應按不小于60m/(h㎡)計算且不小于15,000m/h( 走道不小于13,000m/h) &…

python安裝requests第三方模塊

2018-08-28 22:04:51 1 .下載到桌面后解壓,放到python的目錄下 --------------------------------------------------------------------------------------------------------------------------------------------------------- 2 . 在CMD輸入以下 F:\>cd /d F…

mysql整站源碼安裝_MySQL入門01-MySQL源碼安裝

操作系統:CentOS 6.7MySQL版本:5.6.301.前期準備首先需要CMake,可以yum直接安裝:yum install cmake也可以官網 https://cmake.org/ 下載源碼編譯。我這里選擇了官網下載最新版本cmake-3.5.2.tar.gz。# tar -zxvf cmake-3.5.2.tar.…

集算器協助Java處理結構化文本之條件過濾

直接用Java實現文本文件中數據按條件過濾會有如下的麻煩: 1、文件不是數據庫,不能用SQL訪問。當過濾條件變化時需要改寫代碼。如果要實現象SQL那樣靈活的條件過濾,則需要自己實現動態表達式解析和求值,編程工作量非常大。 2、文件太大時不能一…

python3動態加載模塊的方法實現

2019獨角獸企業重金招聘Python工程師標準>>> 需求 我們有時寫了一個功能,需要不斷地調整,但是已經在線上了,而且在執行任務, 這時要更新上去源文件,而不能結束掉當前進程,怎么辦? 所以這時&…

python 浮點數最小值_PYTHON學習筆記(3)——基本數據類型

本次學習原內容均來自MOOC國家精品課程《Python程序語言設計》嵩天第一篇在問題——“今天python了嗎?”中基本數據類型1、 整數(1)整數無限制 pow(x,y) 計算 (2)四種進制 2、 浮點數類型(1)取整…

2018.08.29 NOIP模擬 pmatrix(線性篩)

【問題描述】 根據哥德巴赫猜想(每個不小于 6 的偶數都可以表示為兩個奇素數之和),定義 哥德巴赫矩陣 A 如下:對于正整數對(i,j),若 ij 為偶數且 i,j 均為奇素數,則 Ai,j 1, 否則 Ai,j 0。現…

Windows Azure移動終端云服務管理(公測版)

概覽 云在遠方,管理在您手中。在這個移動為先 云為先的世界,服務不再是基于請求才提供,而是主動來到身邊方便您的模式了。我們最近將會陸續推出幾大移動端利器幫助您隨時隨地管理您的云服務。 首批利器之中排名第一當屬Azure云助手應用, 它是…

學習opencv3中文版_給視覺組新生的一點學習建議

如果說機械組是把機器人做出來電控組讓機器人動起來那么視覺組就是讓機器人智能化完成一個合格的機器人三者缺一不可今天就讓我們來看看視覺組師兄推薦的學習建議吧!1語言基礎 野狼隊視覺組目前使用的主要語言是C,同時也需要具備一定的C語言基礎。建議…

如何動態改變audio的播放的src

如何動態改變audio的播放的src 一、總結 一句話總結:js方式在請求外部網站的時候行,php方式在請求內外部資源都行。因為php走在js前面,所以問題可以從php方面想辦法。 1、如何使用js控制修改audio的src或它的source 的src屬性實現動態改變aud…

錯誤 open too many files

錯誤:服務器最大打開文件數65535啟動java程序報錯 open too many files解決辦法:1.增加文件描述符 #服務器本來就是65535了2.排查程序 #研發總監4.研發總監和我 一起看服務器lsof -p pid(程序)|wc -l5.最終確定程序的問題6.研發總監 去改…

mysql 水平拆分實例_2021先定個小目標?搞清楚MyCat分片的兩種拆分方法和分片規則!(二):水平拆分實例解析和代碼實現!...

一、概述根據表中的數據的邏輯關系,將同一個表中的數據按照某種條件拆分到多臺數據庫(主機)上面,這種切分稱之為數據的水平(橫向)切分。二、案例場景在業務系統中, 有一張表(日志表), 業務系統每天都會產生大量的日志數據 , 單臺服務器的數據存儲及處理能…

30分鐘快速搭建移動應用直傳OSS服務

30分鐘快速搭建移動應用直傳服務 背景 這是一個移動互聯的時代。手機APP上傳的數據會越來越多。把數據存儲的問題交給OSS, 讓開發者能更加專注于自己的應用邏輯。 那么怎么樣基于OSS構建一個APP存儲系統呢? 目的 本教程就是讓你在30分鐘內搭建一個基于OS…

用java判斷一個年份是否為閏年_判斷閏年還是平年

↑↑↑點擊上方圖片&#xff0c;了解詳情正文&#xff1a;判斷一個年份是閏年還是平年。閏年條件&#xff1a;1.可以被400整除。2.可以被4整除&#xff0c;但是不可以被100整除。代碼&#xff1a;Private Sub 查詢_Click() If Me.年份 Mod 4 0 And Me.年份 Mod 100 <> 0…

PAT L1-048 矩陣A乘以B

https://pintia.cn/problem-sets/994805046380707840/problems/994805082313310208 給定兩個矩陣A和B&#xff0c;要求你計算它們的乘積矩陣AB。需要注意的是&#xff0c;只有規模匹配的矩陣才可以相乘。即若A有R?a??行、C?a??列&#xff0c;B有R?b??行、C?b??列&a…

【JavaScript吉光片羽】--- 滑動條

燈光的亮度控制需要一個滑動條&#xff0c;先借用lamp源碼中Bar&#xff1a; var Bar function (opt) {var defaults {$id: "", // 進度條dom節點idmin: 1, // 刻度最小值stepCount: 5, // 刻度步數step: 1, // 刻度步長$alpha: "",//顯示亮度的idtouchE…

ldd /usr/bin/mysql_mysql客戶端登錄時報mysql: relocation error錯誤

在安裝了xtrabackup后&#xff0c;再用下列命令登錄時報下列錯誤[rootlocalhost ~]# mysql -u root -pmysql: relocation error: mysql: symbol strmov, version libmysqlclient_16 not defined in file libmysqlclient.so.16 with link time reference解決方法&#xff1a;查看…